js console: add cors domain optional argument to startRpc

pull/773/head
zelig 10 years ago
parent a3fb41981e
commit 22450c069b
  1. 11
      cmd/geth/admin.go
  2. 4
      cmd/geth/js_test.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)

@ -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…
Cancel
Save