diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-12 20:03:21 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-04-12 20:03:21 +0800 |
commit | 8627680e24a29abd5f2aaaeaa2c1c852d8fb693b (patch) | |
tree | 1ad39e8b43d04e5a17c17c0b7314eece80620dd5 /rpc/websocket.go | |
parent | 934f587bd5c38a36e8b8c8647a9e600d1751ff2f (diff) | |
parent | aa9fff3e68b1def0a9a22009c233150bf9ba481f (diff) | |
download | dexon-8627680e24a29abd5f2aaaeaa2c1c852d8fb693b.tar.gz dexon-8627680e24a29abd5f2aaaeaa2c1c852d8fb693b.tar.zst dexon-8627680e24a29abd5f2aaaeaa2c1c852d8fb693b.zip |
Merge pull request #2359 from bas-vk/rpc-optional-args
rpc: several fixes and support for optional arguments
Diffstat (limited to 'rpc/websocket.go')
-rw-r--r-- | rpc/websocket.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/websocket.go b/rpc/websocket.go index 499eedabe..1303f98db 100644 --- a/rpc/websocket.go +++ b/rpc/websocket.go @@ -88,10 +88,10 @@ func wsHandshakeValidator(allowedOrigins []string) func(*websocket.Config, *http } // NewWSServer creates a new websocket RPC server around an API provider. -func NewWSServer(cors string, handler *Server) *http.Server { +func NewWSServer(allowedOrigins string, handler *Server) *http.Server { return &http.Server{ Handler: websocket.Server{ - Handshake: wsHandshakeValidator(strings.Split(cors, ",")), + Handshake: wsHandshakeValidator(strings.Split(allowedOrigins, ",")), Handler: func(conn *websocket.Conn) { handler.ServeCodec(NewJSONCodec(&wsReaderWriterCloser{conn}), OptionMethodInvocation|OptionSubscriptions) |