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()
|
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{
|
config := rpc.RpcConfig{
|
||||||
ListenAddress: addr,
|
ListenAddress: addr,
|
||||||
ListenPort: uint(port),
|
ListenPort: uint(port),
|
||||||
// CorsDomain: ctx.GlobalString(RPCCORSDomainFlag.Name),
|
CorsDomain: corsDomain,
|
||||||
}
|
}
|
||||||
|
|
||||||
xeth := xeth.New(js.ethereum, nil)
|
xeth := xeth.New(js.ethereum, nil)
|
||||||
|
@ -3,16 +3,16 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"path/filepath"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
"runtime"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user