Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将我们的一项服务移植到 Aleph。该服务使用 Web 套接字服务器(当前在 http-kit 上运行)。我需要的一件事是能够在 websocket 升级过程中在响应中添加一些自定义 http 标头。你看到我可以做到这一点的方法吗?
详细说明,我需要检查Sec-WebSocket-Extensions客户端请求的标头值,并在升级过程中基于该值添加响应标头。同样需要检查Sec-WebSocket-Protocol请求中的标头,如果协议是我所期望的,则将其添加回响应中。
Sec-WebSocket-Extensions
Sec-WebSocket-Protocol
websocket-connection&都websocket-client接受:headers关键字参数。文档在这里。
websocket-connection
websocket-client
:headers