socket.io-client how to set request header when making connection

后端 未结 5 1431
春和景丽
春和景丽 2020-12-24 05:16

I\'m trying to set a http header when socket.io client makes the connection request. Is there a way to do this?

Here is what i\'m doing:

// server si         


        
5条回答
  •  长情又很酷
    2020-12-24 06:06

    As of version 2.0.0 / 2017-01-22 engine.io-client supports

    [feature] Allow extraHeaders to be set for browser clients in XHR requests (#519)
    

    However at this point the socket.io-client is not updated to support this functionality, so couple of days may make this saga end until that time use the following instructions: https://facundoolano.wordpress.com/2014/10/11/better-authentication-for-socket-io-no-query-strings/

提交回复
热议问题