aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/cmd.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 13fbc7c64..437e0c037 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -39,8 +39,9 @@ import (
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/rlp"
rpchttp "github.com/ethereum/go-ethereum/rpc/http"
+ rpcws "github.com/ethereum/go-ethereum/rpc/websocket"
"github.com/ethereum/go-ethereum/state"
- "github.com/ethereum/go-ethereum/websocket"
+ // "github.com/ethereum/go-ethereum/websocket"
"github.com/ethereum/go-ethereum/xeth"
)
@@ -201,11 +202,18 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
-func StartWebSockets(eth *eth.Ethereum) {
+func StartWebSockets(eth *eth.Ethereum, wsPort int) {
clilogger.Infoln("Starting WebSockets")
- sock := websocket.NewWebSocketServer(eth)
- go sock.Serv()
+ // sock := websocket.NewWebSocketServer(eth)
+ // go sock.Serv()
+ var err error
+ eth.WsServer, err = rpcws.NewWebSocketServer(eth, wsPort)
+ if err != nil {
+ clilogger.Errorf("Could not start RPC interface (port %v): %v", wsPort, err)
+ } else {
+ go eth.WsServer.Start()
+ }
}
var gminer *miner.Miner