aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/websocket.go
diff options
context:
space:
mode:
authorbas-vk <bas-vk@users.noreply.github.com>2017-04-13 05:04:14 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-13 05:04:14 +0800
commit5e29f4be935ff227bbf07a0c6e80e8809f5e0202 (patch)
tree18e1ef8db3c66c3bf777dc90326aa971f1343d34 /rpc/websocket.go
parent43671067fb453a1ed798bcc3d8016710460f2bdf (diff)
downloaddexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar.gz
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar.bz2
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar.lz
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar.xz
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.tar.zst
dexon-5e29f4be935ff227bbf07a0c6e80e8809f5e0202.zip
cmd/utils, node: remove unused solc references and improve RPC config (#14324)
Currently http cors and websocket origins are a comma separated string in the config object. These are replaced with string arrays that are more expressive in case of a config file.
Diffstat (limited to 'rpc/websocket.go')
-rw-r--r--rpc/websocket.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/websocket.go b/rpc/websocket.go
index 587010820..5f9593a43 100644
--- a/rpc/websocket.go
+++ b/rpc/websocket.go
@@ -36,9 +36,9 @@ import (
//
// allowedOrigins should be a comma-separated list of allowed origin URLs.
// To allow connections with any origin, pass "*".
-func (srv *Server) WebsocketHandler(allowedOrigins string) http.Handler {
+func (srv *Server) WebsocketHandler(allowedOrigins []string) http.Handler {
return websocket.Server{
- Handshake: wsHandshakeValidator(strings.Split(allowedOrigins, ",")),
+ Handshake: wsHandshakeValidator(allowedOrigins),
Handler: func(conn *websocket.Conn) {
srv.ServeCodec(NewJSONCodec(conn), OptionMethodInvocation|OptionSubscriptions)
},
@@ -48,7 +48,7 @@ func (srv *Server) WebsocketHandler(allowedOrigins string) http.Handler {
// NewWSServer creates a new websocket RPC server around an API provider.
//
// Deprecated: use Server.WebsocketHandler
-func NewWSServer(allowedOrigins string, srv *Server) *http.Server {
+func NewWSServer(allowedOrigins []string, srv *Server) *http.Server {
return &http.Server{Handler: srv.WebsocketHandler(allowedOrigins)}
}