如何用Boost Beast放置一个定制标头,以供Websocket握手
How can I put a custom header for websocket handshake with boost beast
如何在Websocket中使用Boost Beast在WebSocket中的第一个握手发送自定义标头?
我想在我的初始请求" x-custome-id:xxxxx"中使用自定义标头。
您将不得不将Custum标头放在
您可能想在这里和那里更改一些细节
ws_.async_handshake_ex(host, <endpoint>,
[<somerequestname>](request_type& reqHead) {
reqHead.insert(http::field::<sometype>,xxxxx);},
bind(Some handler));
注意:
您将拥有诸如host
,endpoint
等的详细信息
这是您要正确的方法-reqHead.insert(http::field::<sometype>,xxxxx);}
探索适合您的选项http::field::<sometype>
探索枚举类字段:无签名的简称。
我找到了候选解决方案,如https://github.com/boostorg/beast/issues/70。
但是,这发生了编译器误差,升压1.69。
解决方案也解决了此问题https://github.com/boostorg/beast/issues/1470。
相关文章:
- Websocket++ 错误:收到错误handle_transport_init TLS 握手失败
- 如何使用 boost beast websocket 客户端收听 websocket feed?
- Boost (Beast) websocket:同步写入挂起
- boost beast Websocket Multi Request Server/Client 并不是真正的 mul
- 提升 Websocket 并io_context可重用性,以实现连接的可重新建立性
- 使用websocket时消息被延迟
- Websocket 客户端在 C++ 中使用 boost::Beast - 在写入操作时抛出错误
- 加速兽握手:sslv3 警报握手失败错误
- 在QT中的两个窗口之间共享websocket连接
- 断开连接后重新连接boost beast(asio)websocket和http连接时出错
- 为什么Boost Variant使用模板构造函数而不是Boost::beast::websocket::stream的移
- Websocket握手无效
- WebSocket服务器握手响应
- Boost-beast websocket握手问题
- QT/OSX Websocket打开握手时机
- 如何用Boost Beast放置一个定制标头,以供Websocket握手
- 在 Winsock ws 客户端和 Websocket 服务器之间建立握手
- Websocket握手Sec-Webocket Accept标头值不正确
- 如何解释浏览器的服务器握手的 Sec-websocket-key ?
- WebSocket握手期间出错:秒WebSocket Accept不匹配