Versions in this module Expand all Collapse all v0 v0.2.1 Feb 7, 2015 Changes in this version + const BinaryMessage + const CloseAbnormalClosure + const CloseGoingAway + const CloseInternalServerErr + const CloseInvalidFramePayloadData + const CloseMandatoryExtension + const CloseMessage + const CloseMessageTooBig + const CloseNoStatusReceived + const CloseNormalClosure + const ClosePolicyViolation + const CloseProtocolError + const CloseTLSHandshake + const CloseUnsupportedData + const PingMessage + const PongMessage + const TextMessage + var ErrBadHandshake = errors.New("websocket: bad handshake") + var ErrCloseSent = errors.New("websocket: close sent") + var ErrReadLimit = errors.New("websocket: read limit exceeded") + func FormatCloseMessage(closeCode int, text string) []byte + func ReadJSON(c *Conn, v interface{}) error + func Subprotocols(r *http.Request) []string + func WriteJSON(c *Conn, v interface{}) error + type Conn struct + func NewClient(netConn net.Conn, u *url.URL, requestHeader http.Header, ...) (c *Conn, response *http.Response, err error) + func Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header, ...) (*Conn, error) + func (c *Conn) Close() error + func (c *Conn) LocalAddr() net.Addr + func (c *Conn) NextReader() (messageType int, r io.Reader, err error) + func (c *Conn) NextWriter(messageType int) (io.WriteCloser, error) + func (c *Conn) ReadJSON(v interface{}) error + func (c *Conn) ReadMessage() (messageType int, p []byte, err error) + func (c *Conn) RemoteAddr() net.Addr + func (c *Conn) SetPingHandler(h func(string) error) + func (c *Conn) SetPongHandler(h func(string) error) + func (c *Conn) SetReadDeadline(t time.Time) error + func (c *Conn) SetReadLimit(limit int64) + func (c *Conn) SetWriteDeadline(t time.Time) error + func (c *Conn) Subprotocol() string + func (c *Conn) UnderlyingConn() net.Conn + func (c *Conn) WriteControl(messageType int, data []byte, deadline time.Time) error + func (c *Conn) WriteJSON(v interface{}) error + func (c *Conn) WriteMessage(messageType int, data []byte) error + type Dialer struct + HandshakeTimeout time.Duration + NetDial func(network, addr string) (net.Conn, error) + ReadBufferSize int + Subprotocols []string + TLSClientConfig *tls.Config + WriteBufferSize int + var DefaultDialer *Dialer + func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Response, error) + type HandshakeError struct + func (e HandshakeError) Error() string + type Upgrader struct + CheckOrigin func(r *http.Request) bool + Error func(w http.ResponseWriter, r *http.Request, status int, reason error) + HandshakeTimeout time.Duration + ReadBufferSize int + Subprotocols []string + WriteBufferSize int + func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*Conn, error)