diff --git a/packer/packer.go b/packer/packer.go index f2201f4..880b4f1 100644 --- a/packer/packer.go +++ b/packer/packer.go @@ -34,7 +34,7 @@ func NewPacker(header *Header) *Packer { func splitHeader(header []byte, names []string) (map[string]string, error) { parts := strings.Split(string(header), ",") if p, n := len(parts), len(names); p > n { - return nil, fmt.Errorf("Header contains %d extra fields", p-n) + //return nil, fmt.Errorf("Header contains %d extra fields", p-n) } else if p < n { return nil, fmt.Errorf("Header missing fields %q", names[p:]) } diff --git a/relay/api/connection.go b/relay/api/connection.go index 0d44a3a..d9c7cdf 100755 --- a/relay/api/connection.go +++ b/relay/api/connection.go @@ -257,6 +257,10 @@ func (c *Connection) Reader(ctx context.Context) { // unpack the message. p, err := packer.ReadMessage(message) + if nil != err { + fmt.Println("error during msg parse:", err) + continue + } key := fmt.Sprintf("%s:%d", p.Address(), p.Port()) track, err := connectionTrack.Lookup(key) diff --git a/relay/relay.go b/relay/relay.go index ab1c829..89a1cec 100644 --- a/relay/relay.go +++ b/relay/relay.go @@ -89,6 +89,10 @@ func listenAndServeTargets(mx *mplexy.MPlexy, listener net.Listener) error { log.Println("websocket opening ", r.RemoteAddr, " ", r.Host) authz, err := mx.AuthorizeTarget(r) + if nil != err { + log.Println("WebSocket authorization failed", err) + return + } var upgrader = websocket.Upgrader{ ReadBufferSize: 65535, WriteBufferSize: 65535,