rpc: add CORS workaround for RPC

This one enables our RPC to be called from the browser if there is a
need. It's insecure and not standards-compliant, thus this behaviour is
configurable is not enabled by default. It makes our node with this workaround
enabled compatible with neo-mon monitoring.

Originally debugged by @anatoly-bogatyrev in #464.
This commit is contained in:
Roman Khimov 2019-11-01 13:23:46 +03:00
parent e5205d26a3
commit b46dd295bc
14 changed files with 72 additions and 22 deletions

View file

@ -247,7 +247,7 @@ func startServer(ctx *cli.Context) error {
}
server := network.NewServer(serverConfig, chain)
rpcServer := rpc.NewServer(chain, cfg.ApplicationConfiguration.RPCPort, server)
rpcServer := rpc.NewServer(chain, cfg.ApplicationConfiguration.RPC, server)
errChan := make(chan error)
monitoring := metrics.NewMetricsService(cfg.ApplicationConfiguration.Monitoring)