Is there an equivalent for fetch's “credentials: 'include'” or XMLHttpRequest's “withCredentials” for WebSocket?
问题 I'm setting up a web service that provides both authentication and a WebSocket interface. The API of the server needs to be accessible cross-domain and still receive the cookie set for the server's domain. In fetch , this is possible with the option credentials: "include" and it works well. Is there an equivalent for WebSocket? Basically, I have a Node.js server running on a.com : let app = require("express")() // ... //headers app.use((req, res, next) => { console.log(req.headers) console