From d31303a592bcf8662fbbe66e542535e0e82c5a83 Mon Sep 17 00:00:00 2001 From: Maran Date: Tue, 13 May 2014 12:01:34 +0200 Subject: [PATCH] Implemented support for a custom RPC port --- ethrpc/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ethrpc/server.go b/ethrpc/server.go index a612f1163..3960e641c 100644 --- a/ethrpc/server.go +++ b/ethrpc/server.go @@ -1,6 +1,7 @@ package ethrpc import ( + "fmt" "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "net" @@ -48,8 +49,9 @@ func (s *JsonRpcServer) Start() { } } -func NewJsonRpcServer(ethp *ethpub.PEthereum) (*JsonRpcServer, error) { - l, err := net.Listen("tcp", ":8080") +func NewJsonRpcServer(ethp *ethpub.PEthereum, port int) (*JsonRpcServer, error) { + sport := fmt.Sprintf(":%d", port) + l, err := net.Listen("tcp", sport) if err != nil { return nil, err }