diff --git a/cmd/gwstester/tester.go b/cmd/gwstester/tester.go index 733469d..343d5c1 100644 --- a/cmd/gwstester/tester.go +++ b/cmd/gwstester/tester.go @@ -48,7 +48,7 @@ func manageClient(sock net.Conn) { panic(err) } - fmt.Printf("Upgrade Request: %v\n", req) + fmt.Printf("%v\n", req) break; } diff --git a/http/upgrade/request/private.go b/http/upgrade/request/private.go index 01287a3..a63a297 100644 --- a/http/upgrade/request/private.go +++ b/http/upgrade/request/private.go @@ -37,27 +37,13 @@ func (r *T) parseHeader(b []byte) error { /* (2) Manage header */ switch head.Name { - - case header.HOST: fmt.Printf("[host] ") - err = r.extractHostPort(head.Values) - - case header.ORIGIN: fmt.Printf("[origin] ") - err = r.extractOrigin(head.Values) - - case header.UPGRADE: fmt.Printf("[upgrade] ") - err = r.checkUpgrade(head.Values) - - case header.CONNECTION: fmt.Printf("[connection] ") - err = r.checkConnection(head.Values) - - case header.WSVERSION: fmt.Printf("[sec-websocket-version] ") - err = r.checkVersion(head.Values) - - case header.WSKEY: fmt.Printf("[sec-websocket-key] ") - err = r.extractKey(head.Values) - - case header.WSPROTOCOL: fmt.Printf("[sec-websocket-protocol] ") - err = r.extractProtocols(head.Values) + case header.HOST: err = r.extractHostPort(head.Values) + case header.ORIGIN: err = r.extractOrigin(head.Values) + case header.UPGRADE: err = r.checkUpgrade(head.Values) + case header.CONNECTION: err = r.checkConnection(head.Values) + case header.WSVERSION: err = r.checkVersion(head.Values) + case header.WSKEY: err = r.extractKey(head.Values) + case header.WSPROTOCOL: err = r.extractProtocols(head.Values) default: return nil diff --git a/http/upgrade/request/public.go b/http/upgrade/request/public.go index 005a3a0..77ec7bc 100644 --- a/http/upgrade/request/public.go +++ b/http/upgrade/request/public.go @@ -26,7 +26,6 @@ func Build(r io.Reader) (request *T, err error) { line, err := cr.Read() if err == io.EOF { - fmt.Printf("END OF READING\n"); break } diff --git a/http/upgrade/response/types.go b/http/upgrade/response/types.go new file mode 100644 index 0000000..e69de29