How to use project secret with wss?

Hi,
I am using web3.WebsocketProvider for connecting with infura wss link with project secret enabled but it keeps giving me a connection error.
I was able to set it up using HttpProvider but wss does not work.
I am using the below format
new web3.providers.WebsocketProvider(‘wss://kovan.infura.io/ws/v3/PROJECT-ID’, {
headers: { authorization: PROJECT-SECRET}
})
Can someone help with what exactly needs to be passed in order to get this working?

Hi @sid
With web3js you can pass it in the connection string, example:

new Web3.providers.WebsocketProvider("wss://:YOUR-PROJECT-SECRET@mainnet.infura.io/ws/v3/YOUR-PROJECT-ID")

With wscat you can pass the --auth flag, see https://infura.io/docs/ethereum/wss/introduction

hope this helps.