Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/gorilla/websocket
/ functions
Functions
256 in github.com/gorilla/websocket
⨍
Functions
256
◇
Types & classes
45
↓ 22 callers
Method
Close
()
client_server_test.go:369
↓ 21 callers
Method
Dial
Dial connects to the given address via the proxy.
x_net_proxy.go:163
↓ 21 callers
Function
newTestConn
newTestConn creates a connnection backed by a fake network connection using default values for buffering.
conn_test.go:53
↓ 20 callers
Method
WriteMessage
WriteMessage is a helper method for getting a writer using NextWriter, writing the message and closing the writer.
conn.go:758
↓ 19 callers
Method
Close
Close closes the underlying network connection without sending or waiting for a close message.
conn.go:344
↓ 16 callers
Method
Error
()
conn.go:100
↓ 16 callers
Method
NextWriter
NextWriter returns a writer for the next message to send. The writer's Close method flushes the complete message to the network. There can be at most
conn.go:518
↓ 14 callers
Method
String
()
conn_test.go:47
↓ 13 callers
Function
newServer
(t *testing.T)
client_server_test.go:62
↓ 12 callers
Method
Get
Get gets a value from the pool or returns nil if the pool is empty.
conn.go:231
↓ 12 callers
Method
NextReader
NextReader returns the next data message received from the peer. The returned messageType is either TextMessage or BinaryMessage. There can be at mos
conn.go:998
↓ 12 callers
Method
Upgrade
Upgrade upgrades the HTTP server connection to the WebSocket protocol. The responseHeader is included in the response to the client's upgrade request
server.go:125
↓ 11 callers
Method
ReadMessage
ReadMessage is a helper method for getting a reader using NextReader and reading from that reader to a buffer.
conn.go:1091
↓ 11 callers
Function
newConn
(conn net.Conn, isServer bool, readBufferSize, writeBufferSize int, writeBufferPool BufferPool, br *bufio.Read
conn.go:285
↓ 10 callers
Method
WriteControl
WriteControl writes a control message with the given deadline. The allowed message types are CloseMessage, PingMessage and PongMessage.
conn.go:413
↓ 10 callers
Function
sendRecv
(t *testing.T, ws *Conn)
client_server_test.go:131
↓ 9 callers
Method
Close
()
conn_test.go:29
↓ 9 callers
Function
FormatCloseMessage
FormatCloseMessage formats closeCode and text as a WebSocket close message. An empty message is returned for code CloseNoStatusReceived.
conn.go:1219
↓ 8 callers
Method
Write
(p []byte)
server.go:348
↓ 7 callers
Method
Write
(p []byte)
conn_test.go:305
↓ 6 callers
Method
SetWriteDeadline
SetWriteDeadline sets the write deadline on the underlying network connection. After a write has timed out, the websocket state is corrupt and all fut
conn.go:787
↓ 6 callers
Method
WriteString
(p string)
conn.go:684
↓ 5 callers
Method
SetPongHandler
SetPongHandler sets the handler for pong messages received from the peer. The appData argument to h is the PONG message application data. The default
conn.go:1185
↓ 5 callers
Method
flushFrame
flushFrame writes buffered data and extra as a frame to the network. The final argument indicates that this is the last frame in the message.
conn.go:556
↓ 5 callers
Function
maskBytes
(key [4]byte, pos int, b []byte)
mask.go:14
↓ 5 callers
Function
rootCAs
(t *testing.T, s *httptest.Server)
client_server_test.go:289
↓ 4 callers
Method
DialContext
DialContext creates a new client connection. Use requestHeader to specify the origin (Origin), subprotocols (Sec-WebSocket-Protocol) and cookies (Cook
client.go:159
↓ 4 callers
Function
IsUnexpectedCloseError
IsUnexpectedCloseError returns boolean indicating whether the error is a *CloseError with a code not in the list of expected codes.
conn.go:164
↓ 4 callers
Method
SetReadLimit
SetReadLimit sets the maximum size in bytes for a message read from the peer. If a message exceeds the limit, the connection sends a close message to
conn.go:1112
↓ 4 callers
Function
makeWsProto
(s string)
client_server_test.go:127
↓ 4 callers
Function
tokenListContainsValue
tokenListContainsValue returns true if the 1#token header with the given name contains a token equal to value with ASCII case folding.
util.go:202
↓ 3 callers
Method
Dial
Dial creates a new client connection by calling DialContext with a background context.
client.go:115
↓ 3 callers
Function
IsWebSocketUpgrade
IsWebSocketUpgrade returns true if the client requested upgrade to the WebSocket protocol.
server.go:325
↓ 3 callers
Function
NewPreparedMessage
NewPreparedMessage returns an initialized PreparedMessage. You can then send it to connection using WritePreparedMessage method. Valid wire representa
prepared.go:43
↓ 3 callers
Method
Put
Put adds a value to the pool.
conn.go:233
↓ 3 callers
Method
ReadJSON
ReadJSON reads the next JSON-encoded message from the connection and stores it in the value pointed to by v. See the documentation for the encoding/j
json.go:49
↓ 3 callers
Method
SetDeadline
(t time.Time)
client_server_test.go:339
↓ 3 callers
Method
SetReadDeadline
SetReadDeadline sets the read deadline on the underlying network connection. After a read has timed out, the websocket connection state is corrupt and
conn.go:1105
↓ 3 callers
Function
Subprotocols
Subprotocols returns the subprotocols requested by the client in the Sec-Websocket-Protocol header.
server.go:311
↓ 3 callers
Method
Write
(p []byte)
conn.go:657
↓ 3 callers
Method
WritePreparedMessage
WritePreparedMessage writes prepared message into connection.
conn.go:735
↓ 3 callers
Function
computeAcceptKey
(challengeKey string)
util.go:19
↓ 3 callers
Function
echoReadAll
echoReadAll echoes messages from the client by reading the entire message with ioutil.ReadAll.
examples/autobahn/server.go:88
↓ 3 callers
Function
equalASCIIFold
equalASCIIFold returns true if s is equal to t with ASCII case folding as defined in RFC 4790.
util.go:178
↓ 3 callers
Function
hideTempErr
(err error)
conn.go:189
↓ 3 callers
Function
hostPortNoPort
(u *url.URL)
client.go:121
↓ 3 callers
Function
isControl
(frameType int)
conn.go:196
↓ 3 callers
Function
isData
(frameType int)
conn.go:200
↓ 3 callers
Function
newMaskKey
()
conn.go:184
↓ 3 callers
Function
newTLSServer
(t *testing.T)
client_server_test.go:70
↓ 3 callers
Function
nextToken
nextToken returns the leading RFC 2616 token of s and the string following the token.
util.go:129
↓ 3 callers
Function
parseExtensions
parseExtensions parses WebSocket extensions from a header.
util.go:228
↓ 3 callers
Function
textMessages
(num int)
compression_test.go:35
↓ 3 callers
Method
writeFatal
Write methods
conn.go:360
↓ 2 callers
Method
Close
()
compression.go:140
↓ 2 callers
Method
Error
()
server.go:22
↓ 2 callers
Method
ServeHTTP
(w http.ResponseWriter, r *http.Request)
client_server_test.go:78
↓ 2 callers
Method
SetCompressionLevel
SetCompressionLevel sets the flate compression level for subsequent text and binary messages. This function is a noop if compression was not negotiate
conn.go:1209
↓ 2 callers
Method
SetDeadline
(t time.Time)
conn_test.go:32
↓ 2 callers
Method
Subprotocol
Subprotocol returns the negotiated protocol for the connection.
conn.go:338
↓ 2 callers
Method
Temporary
()
conn.go:101
↓ 2 callers
Method
UnderlyingConn
UnderlyingConn returns the internal net.Conn. This can be used to further modifications to connection specific flags.
conn.go:1194
↓ 2 callers
Method
Write
(p []byte)
client_server_test.go:566
↓ 2 callers
Method
Write
(p []byte)
compression.go:64
↓ 2 callers
Method
WriteJSON
WriteJSON writes the JSON encoding of v as a message. See the documentation for encoding/json Marshal for details about the conversion of Go values t
json.go:23
↓ 2 callers
Method
advanceFrame
Read methods
conn.go:794
↓ 2 callers
Method
beginMessage
beginMessage prepares a connection and message writer for a new message.
conn.go:475
↓ 2 callers
Function
bufioWriterBuffer
bufioWriterBuffer grabs the buffer from a bufio.Writer.
server.go:354
↓ 2 callers
Function
echoCopy
echoCopy echoes messages from the client using io.Copy.
examples/autobahn/server.go:30
↓ 2 callers
Method
frame
(key prepareKey)
prepared.go:62
↓ 2 callers
Method
ncopy
(max int)
conn.go:643
↓ 2 callers
Function
proxy_FromURL
FromURL returns a Dialer given a URL specification and an underlying Dialer for it to make network requests.
x_net_proxy.go:214
↓ 2 callers
Function
readFileIfModified
(lastMod time.Time)
examples/filewatch/main.go:44
↓ 2 callers
Method
setReadRemaining
setReadRemaining tracks the number of bytes remaining on the connection. If n overflows, an ErrReadLimit is returned.
conn.go:328
↓ 2 callers
Function
skipSpace
skipSpace returns a slice of the string s with all leading RFC 2616 linear whitespace removed.
util.go:117
↓ 2 callers
Method
write
(frameType int, deadline time.Time, buf0, buf1 []byte)
conn.go:379
↓ 1 callers
Method
AddFromString
AddFromString parses a string that contains comma-separated values specifying hosts that should use the bypass proxy. Each value is either an IP addre
x_net_proxy.go:100
↓ 1 callers
Method
AddHost
AddHost specifies a host name that will use the bypass proxy.
x_net_proxy.go:153
↓ 1 callers
Method
AddIP
AddIP specifies an IP address that will use the bypass proxy. Note that this will only take effect if a literal IP address is dialed. A connection to
x_net_proxy.go:129
↓ 1 callers
Method
AddNetwork
AddNetwork specifies an IP range that will use the bypass proxy. Note that this will only take effect if a literal IP address is dialed. A connection
x_net_proxy.go:136
↓ 1 callers
Method
AddZone
AddZone specifies a DNS suffix that will use the bypass proxy. A zone of "example.com" matches "example.com" and all of its subdomains.
x_net_proxy.go:142
↓ 1 callers
Method
Hijack
()
server_test.go:80
↓ 1 callers
Function
IsCloseError
IsCloseError returns boolean indicating whether the error is a *CloseError with one of the specified codes.
conn.go:151
↓ 1 callers
Function
JoinMessages
JoinMessages concatenates received messages to create a single io.Reader. The string term is appended to each message. The returned reader does not su
join.go:15
↓ 1 callers
Method
LocalAddr
()
conn_test.go:30
↓ 1 callers
Method
Read
(p []byte)
conn_test.go:679
↓ 1 callers
Method
Read
(b []byte)
conn.go:1038
↓ 1 callers
Function
ReadJSON
ReadJSON reads the next JSON-encoded message from the connection and stores it in the value pointed to by v. Deprecated: Use c.ReadJSON instead.
json.go:40
↓ 1 callers
Method
RemoteAddr
()
conn_test.go:31
↓ 1 callers
Method
SetCloseHandler
SetCloseHandler sets the handler for close messages received from the peer. The code argument to h is the received close code or CloseNoStatusReceived
conn.go:1135
↓ 1 callers
Method
SetPingHandler
SetPingHandler sets the handler for ping messages received from the peer. The appData argument to h is the PING message application data. The default
conn.go:1158
↓ 1 callers
Method
SetReadDeadline
(t time.Time)
client_server_test.go:345
↓ 1 callers
Method
SetWriteDeadline
(t time.Time)
client_server_test.go:350
↓ 1 callers
Method
Timeout
()
conn.go:102
↓ 1 callers
Function
WriteJSON
WriteJSON writes the JSON encoding of v as a message. Deprecated: Use c.WriteJSON instead.
json.go:15
↓ 1 callers
Method
broadcastOnce
(msg *broadcastMessage)
conn_broadcast_test.go:94
↓ 1 callers
Function
bufioReaderSize
bufioReaderSize size returns the size of a bufio.Reader.
server.go:331
↓ 1 callers
Function
checkSameOrigin
checkSameOrigin returns true if the origin is not set or is equal to the request host.
server.go:89
↓ 1 callers
Function
cloneTLSConfig
(cfg *tls.Config)
client.go:417
↓ 1 callers
Method
close
()
conn_broadcast_test.go:90
next →
1–100 of 256, ranked by callers