diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-03 03:13:41 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-03 03:13:41 +0800 |
commit | af6971f823431e091142dc81f1b252f681d086cf (patch) | |
tree | 2b34e0f42adaeebcf28c955249934f7dc5270792 /rpc/http | |
parent | a60a18b080197cad836f18f9d093bba3bcb6cef8 (diff) | |
parent | 65cad14f9b27db396d036f47814d4843d947ac43 (diff) | |
download | dexon-af6971f823431e091142dc81f1b252f681d086cf.tar dexon-af6971f823431e091142dc81f1b252f681d086cf.tar.gz dexon-af6971f823431e091142dc81f1b252f681d086cf.tar.bz2 dexon-af6971f823431e091142dc81f1b252f681d086cf.tar.lz dexon-af6971f823431e091142dc81f1b252f681d086cf.tar.xz dexon-af6971f823431e091142dc81f1b252f681d086cf.tar.zst dexon-af6971f823431e091142dc81f1b252f681d086cf.zip |
Merge remote-tracking branch 'upstream/develop' into blockpool2
Diffstat (limited to 'rpc/http')
-rw-r--r-- | rpc/http/server.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rpc/http/server.go b/rpc/http/server.go index fa66eed48..452b7c9af 100644 --- a/rpc/http/server.go +++ b/rpc/http/server.go @@ -29,8 +29,8 @@ import ( var rpchttplogger = logger.NewLogger("RPC-HTTP") var JSON rpc.JsonWrapper -func NewRpcHttpServer(pipe *xeth.XEth, port int) (*RpcHttpServer, error) { - sport := fmt.Sprintf("127.0.0.1:%d", port) +func NewRpcHttpServer(pipe *xeth.XEth, address string, port int) (*RpcHttpServer, error) { + sport := fmt.Sprintf("%s:%d", address, port) l, err := net.Listen("tcp", sport) if err != nil { return nil, err @@ -41,6 +41,7 @@ func NewRpcHttpServer(pipe *xeth.XEth, port int) (*RpcHttpServer, error) { quit: make(chan bool), pipe: pipe, port: port, + addr: address, }, nil } @@ -49,6 +50,7 @@ type RpcHttpServer struct { listener net.Listener pipe *xeth.XEth port int + addr string } func (s *RpcHttpServer) exitHandler() { @@ -69,7 +71,7 @@ func (s *RpcHttpServer) Stop() { } func (s *RpcHttpServer) Start() { - rpchttplogger.Infof("Starting RPC-HTTP server on port %d", s.port) + rpchttplogger.Infof("Starting RPC-HTTP server on %s:%d", s.addr, s.port) go s.exitHandler() api := rpc.NewEthereumApi(s.pipe) |