• Felix Lange's avatar
    rpc: implement websockets with github.com/gorilla/websocket (#19866) · 04e175b8
    Felix Lange authored
    * rpc: implement websockets with github.com/gorilla/websocket
    
    This change makes package rpc use the github.com/gorilla/websocket
    package for WebSockets instead of golang.org/x/net/websocket. The new
    library is more robust and supports all WebSocket features including
    continuation frames.
    
    There are new tests for two issues with the previously-used library:
    
      - TestWebsocketClientPing checks handling of Ping frames.
      - TestWebsocketLargeCall checks whether the request size limit is
        applied correctly.
    
    * rpc: raise HTTP/WebSocket request size limit to 5MB
    
    * rpc: remove default origin for client connections
    
    The client used to put the local hostname into the Origin header because
    the server wanted an origin to accept the connection, but that's silly:
    Origin is for browsers/websites. The nobody would whitelist a particular
    hostname.
    
    Now that the server doesn't need Origin anymore, don't bother setting
    one for clients. Users who need an origin can use DialWebsocket to
    create a client with arbitrary origin if needed.
    
    * vendor: put golang.org/x/net/websocket back
    
    * rpc: don't set Origin header for empty (default) origin
    
    * rpc: add HTTP status code to handshake error
    
    This makes it easier to debug failing connections.
    
    * ethstats: use github.com/gorilla/websocket
    
    * rpc: fix lint
    04e175b8
Name
Last commit
Last update
.github Loading commit data...
accounts Loading commit data...
build Loading commit data...
cmd Loading commit data...
common Loading commit data...
consensus Loading commit data...
console Loading commit data...
contracts/checkpointoracle Loading commit data...
core Loading commit data...
crypto Loading commit data...
dashboard Loading commit data...
docs/audits Loading commit data...
eth Loading commit data...
ethclient Loading commit data...
ethdb Loading commit data...
ethstats Loading commit data...
event Loading commit data...
graphql Loading commit data...
internal Loading commit data...
les Loading commit data...
light Loading commit data...
log Loading commit data...
metrics Loading commit data...
miner Loading commit data...
mobile Loading commit data...
node Loading commit data...
p2p Loading commit data...
params Loading commit data...
rlp Loading commit data...
rpc Loading commit data...
signer Loading commit data...
swarm Loading commit data...
tests Loading commit data...
trie Loading commit data...
vendor Loading commit data...
whisper Loading commit data...
.dockerignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
COPYING Loading commit data...
COPYING.LESSER Loading commit data...
Dockerfile Loading commit data...
Dockerfile.alltools Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
SECURITY.md Loading commit data...
appveyor.yml Loading commit data...
circle.yml Loading commit data...
interfaces.go Loading commit data...