Enable websockets for mist. Closes #218

This commit is contained in:
obscuren 2014-12-23 15:46:46 +01:00
parent e531c6fc6c
commit f468a9a0e2
2 changed files with 9 additions and 0 deletions

View File

@ -69,6 +69,10 @@ func run() error {
utils.StartRpc(ethereum, RpcPort) utils.StartRpc(ethereum, RpcPort)
} }
if StartWebSockets {
utils.StartWebSockets(ethereum)
}
gui := NewWindow(ethereum, config, clientIdentity, KeyRing, LogLevel) gui := NewWindow(ethereum, config, clientIdentity, KeyRing, LogLevel)
gui.stdLog = stdLog gui.stdLog = stdLog

View File

@ -3,10 +3,13 @@ package utils
import ( import (
"github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/websocket" "github.com/ethereum/go-ethereum/websocket"
"github.com/ethereum/go-ethereum/xeth" "github.com/ethereum/go-ethereum/xeth"
) )
var wslogger = logger.NewLogger("WS")
func args(v ...interface{}) []interface{} { func args(v ...interface{}) []interface{} {
return v return v
} }
@ -106,6 +109,8 @@ func (self *WebSocketServer) Serv() {
} }
func StartWebSockets(eth *eth.Ethereum) { func StartWebSockets(eth *eth.Ethereum) {
wslogger.Infoln("Starting WebSockets")
sock := NewWebSocketServer(eth) sock := NewWebSocketServer(eth)
go sock.Serv() go sock.Serv()
} }