Closed HiVie closed 4 years ago
I'm using Boost 1.72 which works fine for me.
OK,I read your code today. But i was confused that after the server called dispatchProtocolMessage to tell V8 the message, how did you get the response mesasge from v8? i see u implement the V8InspectorChannelImp::sendResponse(int callId, std::unique_ptr
V8 internally calls these virtual methods which you have to implement your own logic what to do with a response and args comes from the method signature: https://github.com/ahmadov/v8_inspector_example/blob/master/deps/include/v8-inspector.h#L280
OK , and one more question, when the server accepted the connection, Chrome would send a message like this. what should I do to this message? Put it to V8 dispatchProtocolMessage or ?
Host: 127.0.0.1:55554 Connection: Upgrade Pragma: no-cache Cache-Control: no-cache User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36 Upgrade: websocket Origin: devtools://devtools Sec-WebSocket-Version: 13 Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Sec-WebSocket-Key: zrdYV99ZaS5U/7OVJlTitw== Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
No, you should not dispatch that message to the V8. This message is for websocket connection and it's important for your WebSocket server implementation. Actually, any websocket server library could handle that message. Once you've a stable websocket connection then you should dispatch the messages come from websocket connection.
when I compile with boost 1.70 something happened
boost_1_70_0/boost/beast/websocket/detail/decorator.hpp:57:28: error: member pointer has incomplete base type 'boost::beast::websocket::detail::decorator::incomplete' void (incomplete::*mf)();