diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-03-01 04:07:46 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-03-01 04:07:46 +0800 |
commit | cdb77f0ecd239fe7a5494891c6a42645904a432b (patch) | |
tree | 27b9a42b43b0bbb7c54a78885cb48d8a40abb3d3 /rpc | |
parent | 43b5777709d9b867d1e2331d5586b914207f354f (diff) | |
parent | ea0517b5396efc7bd47f820ec0263f68f76f29a4 (diff) | |
download | dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar.gz dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar.bz2 dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar.lz dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar.xz dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.tar.zst dexon-cdb77f0ecd239fe7a5494891c6a42645904a432b.zip |
Merge pull request #402 from tgerring/rpcupdates
Set RPC listening address via param
Diffstat (limited to 'rpc')
-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) |