diff options
author | zelig <viktor.tron@gmail.com> | 2015-04-22 01:08:47 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-04-24 19:45:11 +0800 |
commit | 22450c069b181e362710b71a763549cc6bc3e29b (patch) | |
tree | 7359f743adcc1408013441853bf924994bf7a961 /cmd/geth/admin.go | |
parent | a3fb41981e49fd90d8c76b371782831f243a919e (diff) | |
download | go-tangerine-22450c069b181e362710b71a763549cc6bc3e29b.tar.gz go-tangerine-22450c069b181e362710b71a763549cc6bc3e29b.tar.zst go-tangerine-22450c069b181e362710b71a763549cc6bc3e29b.zip |
js console: add cors domain optional argument to startRpc
Diffstat (limited to 'cmd/geth/admin.go')
-rw-r--r-- | cmd/geth/admin.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/cmd/geth/admin.go b/cmd/geth/admin.go index c23fe9b43..b9a455a0d 100644 --- a/cmd/geth/admin.go +++ b/cmd/geth/admin.go @@ -209,10 +209,19 @@ func (js *jsre) startRPC(call otto.FunctionCall) otto.Value { return otto.FalseValue() } + var corsDomain string + if len(call.ArgumentList) > 2 { + corsDomain, err = call.Argument(2).ToString() + if err != nil { + fmt.Println(err) + return otto.FalseValue() + } + } + config := rpc.RpcConfig{ ListenAddress: addr, ListenPort: uint(port), - // CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name), + CorsDomain: corsDomain, } xeth := xeth.New(js.ethereum, nil) |