Skip to content

violates the following Content Security Policy directive when i use a Web Socket "Custom Nodes" optionΒ #178

@vincentlg

Description

@vincentlg

βœ… Prerequisites

const customNodeOptions = {
rpcUrl: 'wss://rpc-mainnet.maticvigil.com/ws',
chainId: 137
}

πŸ› Description

Refused to connect to 'wss://rpc-mainnet.maticvigil.com/ws' because it violates the following Content Security Policy directive: "connect-src 'self' https://.magic.link/ https://.fortmatic.com/ https://.alchemyapi.io/ wss://.ws.alchemyapi.io/ https://.infura.io/ https://.xdai.quiknode.pro ...

🧩 Steps to Reproduce

Subscribe to an event with the web3 magic provider configured as above.

🌎 Environment

Software Version(s)
magic-sdk "magic-sdk": "^4.2.1"

The doc does not describe any restriction on WS RPC
https://docs.magic.link/blockchains/ethereum#configure-custom-nodes

But it seems you need whitelists one or more of this "official" web socket RPC provider

wss://rpc-mainnet.maticvigil.com/ws or
wss://rpc-mainnet.matic.quiknode.pro or
wss://ws-matic-mainnet.chainstacklabs.com or
wss://matic-mainnet-full-ws.bwarelabs.com or
wss://matic-mainnet-archive-ws.bwarelabs.comor
wss://ws-mainnet.matic.network

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions