【问题标题】:CORS policy blocking the access to ethereumCORS 策略阻止访问以太坊
【发布时间】:2019-05-01 07:22:31
【问题描述】:

从源“http://127.0.0.1:8080”访问“http://localhost:8545/”处的 XMLHttpRequest 已被 CORS 策略阻止:对预检请求的响应未通过访问控制检查:“Access-Control-Allow-Credentials”的值' 响应中的标头是 '',当请求的凭据模式为 'include' 时,它必须为 'true'。 XMLHttpRequest 发起的请求的凭证模式由 withCredentials 属性控制。

Web3js 版本:0.20.7

使用以下命令运行: geth --datadir ./peer2DataDir --rpc --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "http://127.0.0.1:8080" --networkid 1114 --port 30303 console 2>> myEth.log

【问题讨论】:

  • --rpccorsdomain "*" 怎么样?
  • @ZulhilmiZainudin 没有帮助:(

标签: ethereum web3js


【解决方案1】:

该错误是在 0.20.7 webjs 中引入的。确保使用 0.20.6,工作正常。

【讨论】:

    猜你喜欢
    • 2021-04-15
    • 2021-10-15
    • 2019-11-01
    • 2021-10-11
    • 2020-05-05
    • 1970-01-01
    • 2023-01-14
    • 2019-12-18
    相关资源
    最近更新 更多