js console: add cors domain optional argument to startRpc

This commit is contained in:
zelig 2015-04-21 18:08:47 +01:00
parent a3fb41981e
commit 22450c069b
2 changed files with 17 additions and 8 deletions

View File

@ -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)

View File

@ -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"
)