• Fumitoshi Ukai's avatar
    go.net/websocket: allow server configurable · 0005f0a0
    Fumitoshi Ukai authored
    Add websocket.Server to configure WebSocket server handler.
    
    - Config.Header is additional headers to send, so you can use it
      to send cookies or so.
      To read cookies, you can use Conn.Request().Header.
    - factor out Handshake.
      You can set func to check origin, subprotocol etc.
      Handler checks origin by default.
    
    Fixes golang/go#4198.
    Fixes golang/go#5178.
    
    R=golang-dev, mikioh.mikioh, crobin
    CC=golang-dev
    https://golang.org/cl/8731044
    0005f0a0
hybi_test.go 19.3 KB