Esempio n. 1
0
func (server *Server) Handshake(config *ws.Config, request *http.Request) (err error) {
	for _, protocol := range config.Protocol {
		if protocol == "cscn" {
			config.Protocol = []string{protocol}
			return nil
		}
	}
	return ws.ErrBadWebSocketProtocol
}
Esempio n. 2
0
func checkWAMPHandshake(config *websocket.Config, req *http.Request) error {
	for _, protocol := range config.Protocol {
		if protocol == "wamp" {
			config.Protocol = []string{protocol}
			return nil
		}
	}
	return websocket.ErrBadWebSocketProtocol
}