forked from cerc-io/plugeth
js console: add cors domain optional argument to startRpc
This commit is contained in:
parent
a3fb41981e
commit
22450c069b
@ -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)
|
||||
|
@ -3,16 +3,16 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/ethereum/go-ethereum/accounts"
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/eth"
|
||||
"runtime"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user