ithewei

Results 131 comments of ithewei

headers["Origin"]这个头部可以设置成自己的域名,如果服务端不验证这个头部字段,你也可以不填

建议你先学习下c++11 lambda函数吧,lambda可以捕获任何参数,包括this指针,这里有示例代码 https://github.com/ithewei/libhv/blob/dd2bb958f9ef41265c66c27d3ff499993a634812/examples/websocket_client_test.cpp#L24

> > headers["Origin"]这个头部可以设置成自己的域名,如果服务端不验证这个头部字段,你也可以不填 > > 那在服务器里面,怎么获取到这个字段,我看websocket_server_test.cpp里面,没有相关的验证这个头的东西? 可以通过req->headers["Origin"]获取这个字端,websocket_server_test.cpp并没有去验证,一些三方的websocket服务可能会验证,如果不验证,你不设置就好了

还没详细研究过openssl dtls用法,如果你集成dtls功能到hv了,欢迎提PR

The ws CLOSE frame is not parsed, and no error code is exposed. If you need it, you have to modify the source code yourself.

`clean_session`选项就是需要自己设置的,不适合在内部写死`cli->clean_session = 1`

`cmake -DWITH_MBEDTLS=ON` to enable mbedtls. If your mbedtls is not in the default search path, you may need to modify cmake yourself and add include_directories and link_directories.

libhv's cmake default header file search path is `${libhv_root}/include` and `${libhv_root}/3rd/include`, libraries search path is `${libhv_root}/lib` and `${libhv_root}/3rd/lib`.

You can copy libraries to root/lib or root/3rd/lib.

建议分成多个PR吧,有些可能为了兼容性不可被接受 hv.lib -> libhv.lib,因为很多项目直接链接的hv.lib,现在已经不方便改了,_static后缀同理