<div dir="ltr"><div><div>Yes it works !!<br><br></div>Thanks help to debug.<br></div><br>Wayne<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-10 11:01 GMT+08:00 Andy Green <span dir="ltr"><<a href="mailto:andy@warmcat.com" target="_blank">andy@warmcat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 02/10/2017 10:29 AM, Wayne Huang wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have found problem about this issue.<br>
<br>
The normal websocket package:<br>
 [Full request URI: <a href="http://10.70.50.187/msg/fa07c9f0-d2ed-4636-83ad-d6f3bee0f452/00000000-0001-0001-0001-000000000008/Q2Cv8iXQQjwngo3heJlitZIXFxxQb3wqZfI3Jp0T" rel="noreferrer" target="_blank">http://10.70.50.187/msg/fa07c9<wbr>f0-d2ed-4636-83ad-d6f3bee0f452<wbr>/00000000-0001-0001-0001-<wbr>000000000008/Q2Cv8iXQQjwngo3he<wbr>JlitZIXFxxQb3wqZfI3Jp0T</a>]<br>
<br>
But the redirect websocket package:<br>
[Full request URI: <a href="http://10.70.50.187msg/fa07c9f0-d2ed-4636-83ad-d6f3bee0f452/00000000-0001-0001-0001-000000000008/Q2Cv8iXQQjwngo3heJlitZIXFxxQb3wqZfI3Jp0T" rel="noreferrer" target="_blank">http://10.70.50.187msg/fa07c9f<wbr>0-d2ed-4636-83ad-d6f3bee0f452/<wbr>00000000-0001-0001-0001-<wbr>000000000008/Q2Cv8iXQQjwngo3he<wbr>JlitZIXFxxQb3wqZfI3Jp0T</a>]<br>
<br>
Which missing '/' between '10.70.50.187' and 'msg'.<br>
</blockquote>
<br>
Does this help?<br>
<br>
<a href="https://github.com/warmcat/libwebsockets/commit/0b3e9e62cbc4824a804fff403ccbcdb744770772" rel="noreferrer" target="_blank">https://github.com/warmcat/lib<wbr>websockets/commit/0b3e9e62cbc4<wbr>824a804fff403ccbcdb744770772</a><br>
<br>
-Andy<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
>From log can see after lws_parse_uri, it get path without '/' :<br>
[2017/02/10 09:59:04:4009] ERR: [lws_client_interpret_server_h<wbr>andshake] 477 p=<a href="http://10.70.50.187:8080/msg/fa07c9f0-d2ed-4636-83ad-d6f3bee0f452/00000000-0001-0001-0001-000000000008/1Z1urPLdWOlcjIy77kNtAL97qtX4cCIkpOqhOeEq" rel="noreferrer" target="_blank">http://10.70.50.187:8080/msg<wbr>/fa07c9f0-d2ed-4636-83ad-d6f3b<wbr>ee0f452/00000000-0001-0001-<wbr>0001-000000000008/1Z1urPLdWOlc<wbr>jIy77kNtAL97qtX4cCIkpOqhOeEq</a><br>
[2017/02/10 09:59:04:4009] ERR: [lws_client_interpret_server_h<wbr>andshake] 485 call lws_client_reset, ads=10.70.50.187, port=8080, path=msg/fa07c9f0-d2ed-4636-83<wbr>ad-d6f3bee0f452/00000000-0001-<wbr>0001-0001-000000000008/1Z1urPL<wbr>dWOlcjIy77kNtAL97qtX4cCIkpOqhO<wbr>eEq<br>
<br>
in lws_parse_uri(p, &prot, &ads, &port, &path) :<br>
*path = slash;<br>
if (*p) {<br>
   // print p='/msg/xx/xx/xx'<br>
   *p++ = '\0';<br>
   // print p='msg/xx/xx/xx'<br>
   if (*p)<br>
      *path = p;<br>
}<br>
<br>
I am not sure if it is intent to cut the '/' when parsing.<br>
<br>
If I manually mark //*p++ = '\0';, it can connect to server perfectly.<br>
<br>
Please help to clarify.<br>
<br>
Thanks,<br>
Wayne<br>
<br>
2017-02-09 18:09 GMT+08:00 Andy Green <<a href="mailto:andy@warmcat.com" target="_blank">andy@warmcat.com</a> <mailto:<a href="mailto:andy@warmcat.com" target="_blank">andy@warmcat.com</a>>>:<br>
<br>
<br>
<br>
    On 9 February 2017 18:02:59 GMT+08:00, Wayne Huang<br>
    <<a href="mailto:zweblack@gmail.com" target="_blank">zweblack@gmail.com</a> <mailto:<a href="mailto:zweblack@gmail.com" target="_blank">zweblack@gmail.com</a>>> wrote:<br>
    >Hello Andy,<br>
    ><br>
    >I use patch and test again, but get HS: ACCEPT missing.<br>
<br>
    What I confirmed worked was the test client going to<br>
    <a href="http://libwebsockets.org" rel="noreferrer" target="_blank">http://libwebsockets.org</a>, and being redirected to<br>
    <a href="https://libwebsockets.org" rel="noreferrer" target="_blank">https://libwebsockets.org</a>.<br>
<br>
    I appreciate you're sending me nice logs but it'd be great if you<br>
    could relate your problem to something I can reproduce.<br>
<br>
    That usually means one of the test apps and some server I can<br>
    reach, if necessary.<br>
<br>
    -Andy<br>
<br>
<br>
    ><br>
    >From server side's log:<br>
    >2017-02-09 17:46:07,764 DEBUG [WebSocketRedirect] -<br>
    WebSocketRedirect:<br>
    >(fa07c9f0-d2ed-4636-83ad-d6f3<wbr>bee0f452,<br>
    >00000000-0001-0001-0001-00000<wbr>0000008) -> List(Location:<br>
    ><a href="http://10.70.50.187:8080/msg/fa07c9f0-d2ed-4636-83ad-d6f3bee0f452/00000000-0001-0001-0001-000000000008/ERMXuXQvvTRbOtAF7uPvufMOBWtTQNPErEL36uze" rel="noreferrer" target="_blank">http://10.70.50.187:8080/msg/<wbr>fa07c9f0-d2ed-4636-83ad-d6f3be<wbr>e0f452/00000000-0001-0001-<wbr>0001-000000000008/ERMXuXQvvTRb<wbr>OtAF7uPvufMOBWtTQNPErEL36uze</a><br>
    <<a href="http://10.70.50.187:8080/msg/fa07c9f0-d2ed-4636-83ad-d6f3bee0f452/00000000-0001-0001-0001-000000000008/ERMXuXQvvTRbOtAF7uPvufMOBWtTQNPErEL36uze" rel="noreferrer" target="_blank">http://10.70.50.187:8080/msg/<wbr>fa07c9f0-d2ed-4636-83ad-d6f3be<wbr>e0f452/00000000-0001-0001-<wbr>0001-000000000008/ERMXuXQvvTRb<wbr>OtAF7uPvufMOBWtTQNPErEL36uze</a>>)<br>
    ><br>
    >2017-02-09 17:46:07,852 WARN [akka.actor.ActorSystemImpl] - Illegal<br>
    >request, responding with status '400 Bad Request': Illegal<br>
    >request-target:<br>
    >Invalid input '/', expected scheme-char, 'EOI', ':', UPPER_ALPHA,<br>
    '@',<br>
    >lower-reg-name-char, pct-encoded or userinfo-char (line 1, column 4):<br>
    >msg/fa07c9f0-d2ed-4636-83ad-d<wbr>6f3bee0f452/00000000-0001-0001<wbr>-0001-000000000008/ERMXuXQvvTR<wbr>bOtAF7uPvufMOBWtTQNPErEL36uze<br>
    ><br>
    >It seems sent incorrect uri '/' ?<br>
    ><br>
    >If I stop client and change ip and port to redirect one then run<br>
    again,<br>
    >it<br>
    >still can connect to server successfully.<br>
    ><br>
    >Any advice or something I can try to print ?<br>
    ><br>
    >Wayne<br>
    ><br>
    >---Failed log---------------------------<wbr>----------------------------<br>
    >[ws_start_service]: websocket service starting ...<br>
    ><br>
    >====== ws service info ======<br>
    >host=10.70.50.187<br>
    >port=80<br>
    >path=/msg/fa07c9f0-d2ed-4636-<wbr>83ad-d6f3bee0f452/00000000-000<wbr>1-0001-0001-000000000008/ERMXu<wbr>XQvvTRbOtAF7uPvufMOBWtTQNPErEL<wbr>36uze<br>
    >==================<br>
    ><br>
    >ws_callback: LWS_CALLBACK_PROTOCOL_INIT<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_ADD_POLL_FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_WSI_CREATE<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CLIENT_APPEND_HAN<wbr>DSHAKE_HEADER<br>
    >[2017/02/09 17:46:07:2095] NOTICE: Initial logging level 7<br>
    >[2017/02/09 17:46:07:2096] NOTICE: Libwebsockets version: 2.1.0<br>
    >wayne_huang@aynede-Mac-mini.l<wbr>ocal-v2.0.0-255-g31c5130<br>
    >[2017/02/09 17:46:07:2096] NOTICE: IPV6 not compiled in<br>
    >[2017/02/09 17:46:07:2096] NOTICE: libev support not compiled in<br>
    >[2017/02/09 17:46:07:2096] NOTICE: libuv support not compiled in<br>
    >[2017/02/09 17:46:07:2097] NOTICE:  Threads: 4 each 2560 fds<br>
    >[2017/02/09 17:46:07:2098] NOTICE:  mem: platform fd map: 81920 bytes<br>
    >[2017/02/09 17:46:07:2098] NOTICE:  Compiled with OpenSSL support<br>
    >[2017/02/09 17:46:07:2098] NOTICE:  SSL disabled: no<br>
    >LWS_SERVER_OPTION_DO_SSL_GLOB<wbr>AL_INIT<br>
    >[2017/02/09 17:46:07:2098] NOTICE: Creating Vhost 'default' port<br>
    -1, 1<br>
    >protocols, IPv6 off<br>
    >[2017/02/09 17:46:07:2098] NOTICE:  mem: per-conn:       568 bytes +<br>
    >protocol rx buf<br>
    >[2017/02/09 17:46:07:2098] NOTICE:  canonical_hostname =<br>
    >aynede-Mac-mini.local<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_via_info2]<br>
    731 call<br>
    >lws_client_connect_2<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2][18] enter ===<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2] 28<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2] 52 not proxy<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2] 60 socket<br>
    >server_addr4.sin_port=80<br>
    >[2017/02/09 17:46:07:2099] NOTICE: lws_client_connect_2: address<br>
    >10.70.50.187<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >[2017/02/09 17:46:07:2099] ERR: [lws_client_connect_2] 119<br>
    >[2017/02/09 17:46:07:2108] ERR: [lws_client_connect_2] 173 socket<br>
    >invalid =<br>
    >null<br>
    >[2017/02/09 17:46:07:2108] ERR: [lws_client_connect_2] 185 socket<br>
    bind<br>
    >again, valid not null !!!<br>
    >[2017/02/09 17:46:07:2119] ERR: [lws_client_connect_2] 193 set<br>
    >wsi->mode =<br>
    >LWSCM_WSCL_WAITING_CONNECT<br>
    >[2017/02/09 17:46:07:2119] ERR: [lws_client_connect_2] 210 past here,<br>
    >we<br>
    >can't simply free the structs as error handling as oom4 does.  We<br>
    have<br>
    >to<br>
    >run the whole close flow.<br>
    >[2017/02/09 17:46:07:2120] ERR: [lws_client_connect_2] 245<br>
    nonblocking<br>
    >connect retry (errno = 36)<br>
    >[2017/02/09 17:46:07:2120] ERR: [lws_client_connect_2] 262 return wsi<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=34<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_socket_service] 89<br>
    >LWSCM_WSCL_WAITING_CONNECT=34<wbr>, call lws_client_connect_2<br>
    >[2017/02/09 17:46:07:2122] ERR: we are under<br>
    >PENDING_TIMEOUT_SENT_CLIENT_H<wbr>ANDSHAKE timeout protection set in<br>
    >client-handshake.c<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_connect_2][18] enter ===<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_connect_2] 28<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_connect_2] 52 not proxy<br>
    >[2017/02/09 17:46:07:2122] ERR: [lws_client_connect_2] 60 socket<br>
    >server_addr4.sin_port=80<br>
    >[2017/02/09 17:46:07:2123] NOTICE: lws_client_connect_2: address<br>
    >10.70.50.187<br>
    >[2017/02/09 17:46:07:2123] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >[2017/02/09 17:46:07:2123] ERR: [lws_client_connect_2] 119<br>
    >[2017/02/09 17:46:07:2129] ERR: [lws_client_connect_2] 225 socket<br>
    valid<br>
    >not<br>
    >null<br>
    >[2017/02/09 17:46:07:2129] ERR: [lws_client_connect_2] 272 connected<br>
    >[2017/02/09 17:46:07:2129] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >[2017/02/09 17:46:07:2129] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=36<br>
    >[2017/02/09 17:46:07:2129] ERR: [lws_client_socket_service] 144<br>
    >LWSCM_WSCL_ISSUE_HANDSHAKE<br>
    >[2017/02/09 17:46:07:2158] ERR: [lws_service_fd_tsi] 1143 goto<br>
    handled<br>
    >[2017/02/09 17:46:07:2159] ERR: [lws_service_fd_tsi] 1143 goto<br>
    handled<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_DEL_POLL_FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_ADD_POLL_FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_WSI_CREATE<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >[2017/02/09 17:46:07:8150] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >[2017/02/09 17:46:07:8150] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=40<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_CLIENT_APPEND_HAN<wbr>DSHAKE_HEADER<br>
    >[2017/02/09 17:46:07:8150] ERR: [lws_client_socket_service] 247<br>
    >LWSCM_WSCL_WAITING_SERVER_REP<wbr>LY<br>
    >[2017/02/09 17:46:07:8153] ERR: [lws_client_socket_service] 315 call<br>
    >lws_client_interpret_server_h<wbr>andshake<br>
    >[2017/02/09 17:46:07:8153] ERR:<br>
    [lws_client_interpret_server_h<wbr>andshake]<br>
    >470<br>
    >http_response=301<br>
    >[2017/02/09 17:46:07:8153] NOTICE: ssl 0<br>
    >[2017/02/09 17:46:07:8153] ERR:<br>
    [lws_client_interpret_server_h<wbr>andshake]<br>
    >485<br>
    >call lws_client_reset, ads=10.70.50.187, port=8080,<br>
    >path=msg/fa07c9f0-d2ed-4636-8<wbr>3ad-d6f3bee0f452/00000000-0001<wbr>-0001-0001-000000000008/ERMXuX<wbr>QvvTRbOtAF7uPvufMOBWtTQNPErEL3<wbr>6uze<br>
    >[2017/02/09 17:46:07:8153] NOTICE: ssl 0 http<br>
    >[2017/02/09 17:46:07:8153] ERR: [lws_client_connect_2] 398 copy to<br>
    >protocol<br>
    >p=ws-protocol<br>
    >[2017/02/09 17:46:07:8153] NOTICE: redirect ads='10.70.50.187',<br>
    >port=8080,<br>
    >path='msg/fa07c9f0-d2ed-4636-<wbr>83ad-d6f3bee0f452/00000000-000<wbr>1-0001-0001-000000000008/ERMXu<wbr>XQvvTRbOtAF7uPvufMOBWtTQNPErEL<wbr>36uze',<br>
    >ssl = 0<br>
    >[2017/02/09 17:46:07:8154] NOTICE: [lws_client_connect_2] 428 check<br>
    >address=10.70.50.187,<br>
    >path=msg/fa07c9f0-d2ed-4636-8<wbr>3ad-d6f3bee0f452/00000000-0001<wbr>-0001-0001-000000000008/ERMXuX<wbr>QvvTRbOtAF7uPvufMOBWtTQNPErEL3<wbr>6uze,<br>
    >host=10.70.50.187<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 433<br>
    >lws_hdr_simple_create protocol = ws-protocol<br>
    >[2017/02/09 17:46:07:8154] NOTICE: [lws_client_reset] 441 call<br>
    >lws_client_connect_2<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2][18] enter ===<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 28<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 52 not proxy<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 60 socket<br>
    >server_addr4.sin_port=8080<br>
    >[2017/02/09 17:46:07:8154] NOTICE: lws_client_connect_2: address<br>
    >10.70.50.187<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >[2017/02/09 17:46:07:8154] ERR: [lws_client_connect_2] 119<br>
    >[2017/02/09 17:46:07:8159] ERR: [lws_client_connect_2] 173 socket<br>
    >invalid =<br>
    >null<br>
    >[2017/02/09 17:46:07:8160] ERR: [lws_client_connect_2] 185 socket<br>
    bind<br>
    >again, valid not null !!!<br>
    >[2017/02/09 17:46:07:8160] ERR: [lws_client_connect_2] 193 set<br>
    >wsi->mode =<br>
    >LWSCM_WSCL_WAITING_CONNECT<br>
    >[2017/02/09 17:46:07:8160] ERR: [lws_client_connect_2] 210 past here,<br>
    >we<br>
    >can't simply free the structs as error handling as oom4 does.  We<br>
    have<br>
    >to<br>
    >run the whole close flow.<br>
    >[2017/02/09 17:46:07:8160] ERR: [lws_client_connect_2] 245<br>
    nonblocking<br>
    >connect retry (errno = 36)<br>
    >[2017/02/09 17:46:07:8161] ERR: [lws_client_connect_2] 262 return wsi<br>
    >[2017/02/09 17:46:07:8161] ERR: [lws_service_fd_tsi] 1143 goto<br>
    handled<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=34<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_socket_service] 89<br>
    >LWSCM_WSCL_WAITING_CONNECT=34<wbr>, call lws_client_connect_2<br>
    >[2017/02/09 17:46:07:8162] ERR: we are under<br>
    >PENDING_TIMEOUT_SENT_CLIENT_H<wbr>ANDSHAKE timeout protection set in<br>
    >client-handshake.c<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2][18] enter ===<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2] 28<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2] 52 not proxy<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2] 60 socket<br>
    >server_addr4.sin_port=8080<br>
    >[2017/02/09 17:46:07:8162] NOTICE: lws_client_connect_2: address<br>
    >10.70.50.187<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >[2017/02/09 17:46:07:8162] ERR: [lws_client_connect_2] 119<br>
    >[2017/02/09 17:46:07:8167] ERR: [lws_client_connect_2] 225 socket<br>
    valid<br>
    >not<br>
    >null<br>
    >[2017/02/09 17:46:07:8167] ERR: [lws_client_connect_2] 272 connected<br>
    >[2017/02/09 17:46:07:8167] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >[2017/02/09 17:46:07:8167] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=36<br>
    >[2017/02/09 17:46:07:8167] ERR: [lws_client_socket_service] 144<br>
    >LWSCM_WSCL_ISSUE_HANDSHAKE<br>
    >[2017/02/09 17:46:07:8168] ERR: [lws_service_fd_tsi] 1143 goto<br>
    handled<br>
    >[2017/02/09 17:46:07:8168] ERR: [lws_service_fd_tsi] 1143 goto<br>
    handled<br>
    >ws_callback: LWS_CALLBACK_CLIENT_CONNECTION<wbr>_ERROR<br>
    >[ws_callback] Connect with server error: HS: ACCEPT missing<br>
    >[2017/02/09 17:46:07:8548] ERR: [lws_service_fd_tsi] 1140 call<br>
    >lws_client_socket_service<br>
    >ws_callback: LWS_CALLBACK_CLOSED_CLIENT_HTT<wbr>P<br>
    >ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_DEL_POLL_FD<br>
    >ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >ws_callback: LWS_CALLBACK_WSI_DESTROY<br>
    >ws_callback: LWS_CALLBACK_PROTOCOL_DESTROY<br>
    >[2017/02/09 17:46:07:8548] ERR: [lws_client_socket_service] 85<br>
    >wsi->mode=40<br>
    >[2017/02/09 17:46:07:8548] ERR: [lws_client_socket_service] 247<br>
    >LWSCM_WSCL_WAITING_SERVER_REP<wbr>LY<br>
    >[2017/02/09 17:46:07:8551] ERR: [lws_client_socket_service] 315 call<br>
    >lws_client_interpret_server_h<wbr>andshake<br>
    >[2017/02/09 17:46:07:8551] ERR:<br>
    [lws_client_interpret_server_h<wbr>andshake]<br>
    >470<br>
    >http_response=400<br>
    >[2017/02/09 17:46:07:8567] ERR: [lws_service_fd_tsi] 1142 retrun 1<br>
    >[2017/02/09 17:46:07:8567] NOTICE: lws_context_destroy: ctx<br>
    >0x7fa3dc803c00<br>
    >[2017/02/09 17:46:07:8567] NOTICE: lws_context_destroy2: ctx<br>
    >0x7fa3dc803c00<br>
    ><br>
    ><br>
    >2017-02-09 15:27 GMT+08:00 Andy Green <<a href="mailto:andy@warmcat.com" target="_blank">andy@warmcat.com</a><br>
    <mailto:<a href="mailto:andy@warmcat.com" target="_blank">andy@warmcat.com</a>>>:<br>
    ><br>
    >><br>
    >><br>
    >> On 02/09/2017 02:40 PM, 黃小偉 wrote:<br>
    >><br>
    >>> Hello,<br>
    >>><br>
    >>> I have a problem when my client received websocket redirect<br>
    response<br>
    >from<br>
    >>> server.<br>
    >>><br>
    >>> Scenario:<br>
    >>> a. Connect to server with ip:A, port:B<br>
    >>> b. Server response redirect information with ip:C, port:D<br>
    >>> c. libwebsocket try to connect with lws_client_reset but<br>
    failed due<br>
    >to<br>
    >>> LWS_ERRNO = 36 = LWS_EINPROGRESS and no more retry<br>
    >>> d. Client received LWS_CALLBACK_CLIENT_CONNECTION<wbr>_ERROR with<br>
    reason<br>
    >"HS:<br>
    >>> Redirect failed."<br>
    >>><br>
    >>> If I stop client and change ip to C and port to D then run it, it<br>
    >can<br>
    >>> connect to server successfully.<br>
    >>><br>
    >>> I am using latest libwebsocket version.<br>
    >>><br>
    >>> How can I deal with this situation ? Any advice or something<br>
    to try<br>
    >?<br>
    >>><br>
    >><br>
    >> I pushed a patch on master that should fix it<br>
    >><br>
    >> <a href="https://github.com/warmcat/libwebsockets/commit/ce70d583d457" rel="noreferrer" target="_blank">https://github.com/warmcat/lib<wbr>websockets/commit/ce70d583d457</a><br>
    <<a href="https://github.com/warmcat/libwebsockets/commit/ce70d583d457" rel="noreferrer" target="_blank">https://github.com/warmcat/li<wbr>bwebsockets/commit/ce70d583d45<wbr>7</a>><br>
    >> 0f6c9c70177a47166c467ff60c7d<br>
    >><br>
    >> Client redirect had rotted a bit anyway, but until this patch<br>
    it was<br>
    >also<br>
    >> missing the ability to redirect between http / https and vice<br>
    versa;<br>
    >that<br>
    >> should now work.<br>
    >><br>
    >> -Andy<br>
    >><br>
    >> Appreciate it.<br>
    >>><br>
    >>> ----FAILED<br>
    >LOG--------------------------<wbr>-----------------------------<br>
    >>> [ws_start_service]: websocket service starting ...<br>
    >>><br>
    >>> ====== ws service info ======<br>
    >>> host=10.70.50.187<br>
    >>> port=80<br>
    >>> path=/msg/fa07c9f0-d2ed-4636-8<wbr>3ad-d6f3bee0f452/00000000-0001<br>
    >>> -0001-0001-000000000008/BUZqud<wbr>wFqzmwKF8fvMSu9FFb4TmTyqeb6RGf<wbr>1ijd<br>
    >>> ==================<br>
    >>><br>
    >>> ws_callback: LWS_CALLBACK_PROTOCOL_INIT<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_ADD_POLL_FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_WSI_CREATE<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CLIENT_APPEND_HAN<wbr>DSHAKE_HEADER<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE: Initial logging level 7<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE: Libwebsockets version: 2.1.0<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE: IPV6 not compiled in<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE: libev support not compiled in<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE: libuv support not compiled in<br>
    >>> [2017/02/09 13:40:08:4191] NOTICE:  Threads: 4 each 2560 fds<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE:  mem: platform fd map: 81920<br>
    >bytes<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE:  Compiled with OpenSSL support<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE:  SSL disabled: no<br>
    >>> LWS_SERVER_OPTION_DO_SSL_GLOBA<wbr>L_INIT<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE: Creating Vhost 'default'<br>
    port -1,<br>
    >1<br>
    >>> protocols, IPv6 off<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE:  mem: per-conn:          568<br>
    >bytes +<br>
    >>> protocol rx buf<br>
    >>> [2017/02/09 13:40:08:4193] NOTICE: canonical_hostname =<br>
    >Mac-mini.local<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_via_info2] 731<br>
    >call<br>
    >>> lws_client_connect_2<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2][18]<br>
    enter ===<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2] 28<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2] 52 not<br>
    proxy<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2] 60 socket<br>
    >>> server_addr4.sin_port=80<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >>> [2017/02/09 13:40:08:4194] ERR: [lws_client_connect_2] 119<br>
    >>> [2017/02/09 13:40:08:4203] ERR: [lws_client_connect_2] 173 socket<br>
    >invalid<br>
    >>> = null<br>
    >>> [2017/02/09 13:40:08:4203] ERR: [lws_client_connect_2] 185 socket<br>
    >bind<br>
    >>> again, valid not null !!!<br>
    >>> [2017/02/09 13:40:08:4213] ERR: [lws_client_connect_2] 193 set<br>
    >wsi->mode<br>
    >>> = LWSCM_WSCL_WAITING_CONNECT<br>
    >>> [2017/02/09 13:40:08:4213] ERR: [lws_client_connect_2] 210 past<br>
    >here, we<br>
    >>> can't simply free the structs as error handling as oom4 does.  We<br>
    >have to<br>
    >>> run the whole close flow.<br>
    >>> [2017/02/09 13:40:08:4213] ERR: [lws_client_connect_2] 237 check<br>
    >again:<br>
    >>> socket valid o<br>
    >>> [2017/02/09 13:40:08:4214] ERR: [lws_client_connect_2] 245<br>
    >nonblocking<br>
    >>> connect retry (errno = 36)<br>
    >>> [2017/02/09 13:40:08:4214] ERR: [lws_client_connect_2] 262 return<br>
    >wsi<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=34<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_socket_service] 89<br>
    >>> LWSCM_WSCL_WAITING_CONNECT=34, call lws_client_connect_2<br>
    >>> [2017/02/09 13:40:08:4215] ERR: we are under<br>
    >>> PENDING_TIMEOUT_SENT_CLIENT_HA<wbr>NDSHAKE timeout protection set in<br>
    >>> client-handshake.c<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2][18]<br>
    enter ===<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2] 28<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2] 52 not<br>
    proxy<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2] 60 socket<br>
    >>> server_addr4.sin_port=80<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >>> [2017/02/09 13:40:08:4215] ERR: [lws_client_connect_2] 119<br>
    >>> [2017/02/09 13:40:08:4219] ERR: [lws_client_connect_2] 225 socket<br>
    >valid<br>
    >>> not null<br>
    >>> [2017/02/09 13:40:08:4220] ERR: [lws_client_connect_2] 237 check<br>
    >again:<br>
    >>> socket valid o<br>
    >>> [2017/02/09 13:40:08:4220] ERR: [lws_client_connect_2] 272<br>
    connected<br>
    >>> [2017/02/09 13:40:08:4220] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:40:08:4220] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=36<br>
    >>> [2017/02/09 13:40:08:4220] ERR: [lws_client_socket_service] 144<br>
    >>> LWSCM_WSCL_ISSUE_HANDSHAKE<br>
    >>> [2017/02/09 13:40:08:4312] ERR: [lws_service_fd_tsi] 1143 goto<br>
    >handled<br>
    >>> [2017/02/09 13:40:08:4312] ERR: [lws_service_fd_tsi] 1143 goto<br>
    >handled<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_DEL_POLL_FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_ADD_POLL_FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_WSI_CREATE<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CLIENT_CONNECTION<wbr>_ERROR<br>
    >>> [ws_callback] Connect with server error: HS: Redirect failed<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_DEL_POLL_FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> [2017/02/09 13:40:08:4361] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:40:08:4361] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=40<br>
    >>> [2017/02/09 13:40:08:4361] ERR: [lws_client_socket_service] 247<br>
    >>> LWSCM_WSCL_WAITING_SERVER_REPL<wbr>Y<br>
    >>> [2017/02/09 13:40:08:4365] ERR: [lws_client_socket_service]<br>
    315 call<br>
    >>> lws_client_interpret_server_ha<wbr>ndshake<br>
    >>> [2017/02/09 13:40:08:4365] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 470 http_response=301<br>
    >>> [2017/02/09 13:40:08:4365] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 485 call lws_client_reset, ads=10.70.50.187, port=8080,<br>
    >>> path=msg/fa07c9f0-d2ed-4636-83<wbr>ad-d6f3bee0f452/00000000-0001-<br>
    >>> 0001-0001-000000000008/BUZqudw<wbr>FqzmwKF8fvMSu9FFb4TmTyqeb6RGf1<wbr>ijd<br>
    >>> [2017/02/09 13:40:08:4366] NOTICE: [lws_client_reset] 392 redirect<br>
    >>> ads='10.70.50.187', port=8080, path='msg/fa07c9f0-d2ed-4636-8<br>
    >>> 3ad-d6f3bee0f452/00000000-0001<wbr>-0001-0001-000000000008/BUZqud<br>
    >>> wFqzmwKF8fvMSu9FFb4TmTyqeb6RGf<wbr>1ijd'<br>
    >>> [2017/02/09 13:40:08:4366] NOTICE: [lws_client_reset] 410 call<br>
    >>> lws_client_connect_2<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2][18]<br>
    enter ===<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2] 28<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2] 52 not<br>
    proxy<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2] 60 socket<br>
    >>> server_addr4.sin_port=8080<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >>> [2017/02/09 13:40:08:4366] ERR: [lws_client_connect_2] 119<br>
    >>> [2017/02/09 13:40:08:4370] ERR: [lws_client_connect_2] 173 socket<br>
    >invalid<br>
    >>> = null<br>
    >>> [2017/02/09 13:40:08:4370] ERR: [lws_client_connect_2] 185 socket<br>
    >bind<br>
    >>> again, valid not null !!!<br>
    >>> [2017/02/09 13:40:08:4370] ERR: [lws_client_connect_2] 193 set<br>
    >wsi->mode<br>
    >>> = LWSCM_WSCL_WAITING_CONNECT<br>
    >>> [2017/02/09 13:40:08:4370] ERR: [lws_client_connect_2] 210 past<br>
    >here, we<br>
    >>> can't simply free the structs as error handling as oom4 does.  We<br>
    >have to<br>
    >>> run the whole close flow.<br>
    >>> [2017/02/09 13:40:08:4371] ERR: [lws_client_connect_2] 237 check<br>
    >again:<br>
    >>> socket valid o<br>
    >>> [2017/02/09 13:40:08:4371] ERR: [lws_client_connect_2] 245<br>
    >nonblocking<br>
    >>> connect retry (errno = 36)<br>
    >>> [2017/02/09 13:40:08:4371] ERR: [lws_client_connect_2] 262 return<br>
    >wsi<br>
    >>> [2017/02/09 13:40:08:4371] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 487 Redirect failed<br>
    >>> [2017/02/09 13:40:08:4371] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 488 check wsi->mode=34<br>
    >>> ws_callback: LWS_CALLBACK_WSI_DESTROY<br>
    >>> [2017/02/09 13:40:08:4387] ERR: [lws_service_fd_tsi] 1142 retrun 1<br>
    >>><br>
    >>> ----SUCCESS<br>
    >LOG--------------------------<wbr>-----------------------------<br>
    >>> [ws_start_service]: websocket service starting ...<br>
    >>><br>
    >>> ====== ws service info ======<br>
    >>> host=10.70.50.187<br>
    >>> port=8080<br>
    >>> path=/msg/fa07c9f0-d2ed-4636-8<wbr>3ad-d6f3bee0f452/00000000-0001<br>
    >>> -0001-0001-000000000008/BUZqud<wbr>wFqzmwKF8fvMSu9FFb4TmTyqeb6RGf<wbr>1ijd<br>
    >>> ==================<br>
    >>><br>
    >>> ws_callback: LWS_CALLBACK_PROTOCOL_INIT<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_ADD_POLL_FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_WSI_CREATE<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_GET_THREAD_ID<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_LOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CHANGE_MODE_POLL_<wbr>FD<br>
    >>> ws_callback: LWS_CALLBACK_UNLOCK_POLL<br>
    >>> ws_callback: LWS_CALLBACK_CLIENT_APPEND_HAN<wbr>DSHAKE_HEADER<br>
    >>> [2017/02/09 13:38:17:8137] NOTICE: Initial logging level 7<br>
    >>> [2017/02/09 13:38:17:8137] NOTICE: Libwebsockets version: 2.1.0<br>
    >>> [2017/02/09 13:38:17:8137] NOTICE: IPV6 not compiled in<br>
    >>> [2017/02/09 13:38:17:8137] NOTICE: libev support not compiled in<br>
    >>> [2017/02/09 13:38:17:8137] NOTICE: libuv support not compiled in<br>
    >>> [2017/02/09 13:38:17:8138] NOTICE:  Threads: 4 each 2560 fds<br>
    >>> [2017/02/09 13:38:17:8140] NOTICE:  mem: platform fd map: 81920<br>
    >bytes<br>
    >>> [2017/02/09 13:38:17:8143] NOTICE:  Compiled with OpenSSL support<br>
    >>> [2017/02/09 13:38:17:8143] NOTICE:  SSL disabled: no<br>
    >>> LWS_SERVER_OPTION_DO_SSL_GLOBA<wbr>L_INIT<br>
    >>> [2017/02/09 13:38:17:8143] NOTICE: Creating Vhost 'default'<br>
    port -1,<br>
    >1<br>
    >>> protocols, IPv6 off<br>
    >>> [2017/02/09 13:38:17:8143] NOTICE:  mem: per-conn:          568<br>
    >bytes +<br>
    >>> protocol rx buf<br>
    >>> [2017/02/09 13:38:17:8145] NOTICE: canonical_hostname =<br>
    >Mac-mini.local<br>
    >>> [2017/02/09 13:38:17:8147] ERR: [lws_client_connect_via_info2] 731<br>
    >call<br>
    >>> lws_client_connect_2<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2][18]<br>
    enter ===<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2] 28<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2] 52 not<br>
    proxy<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2] 60 socket<br>
    >>> server_addr4.sin_port=8080<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >>> [2017/02/09 13:38:17:8150] ERR: [lws_client_connect_2] 119<br>
    >>> [2017/02/09 13:38:17:8161] ERR: [lws_client_connect_2] 173 socket<br>
    >invalid<br>
    >>> = null<br>
    >>> [2017/02/09 13:38:17:8162] ERR: [lws_client_connect_2] 185 socket<br>
    >bind<br>
    >>> again, valid not null !!!<br>
    >>> [2017/02/09 13:38:17:8170] ERR: [lws_client_connect_2] 193 set<br>
    >wsi->mode<br>
    >>> = LWSCM_WSCL_WAITING_CONNECT<br>
    >>> [2017/02/09 13:38:17:8171] ERR: [lws_client_connect_2] 210 past<br>
    >here, we<br>
    >>> can't simply free the structs as error handling as oom4 does.  We<br>
    >have to<br>
    >>> run the whole close flow.<br>
    >>> [2017/02/09 13:38:17:8171] ERR: [lws_client_connect_2] 237 check<br>
    >again:<br>
    >>> socket valid o<br>
    >>> [2017/02/09 13:38:17:8171] ERR: [lws_client_connect_2] 245<br>
    >nonblocking<br>
    >>> connect retry (errno = 36)<br>
    >>> [2017/02/09 13:38:17:8171] ERR: [lws_client_connect_2] 262 return<br>
    >wsi<br>
    >>> [2017/02/09 13:38:17:8172] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:38:17:8172] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=34<br>
    >>> [2017/02/09 13:38:17:8172] ERR: [lws_client_socket_service] 89<br>
    >>> LWSCM_WSCL_WAITING_CONNECT=34, call lws_client_connect_2<br>
    >>> [2017/02/09 13:38:17:8173] ERR: we are under<br>
    >>> PENDING_TIMEOUT_SENT_CLIENT_HA<wbr>NDSHAKE timeout protection set in<br>
    >>> client-handshake.c<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2][18]<br>
    enter ===<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2] 28<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2] 52 not<br>
    proxy<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2] 60 socket<br>
    >>> server_addr4.sin_port=8080<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2] 67<br>
    >ads=10.70.50.187<br>
    >>> [2017/02/09 13:38:17:8173] ERR: [lws_client_connect_2] 119<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_client_connect_2] 225 socket<br>
    >valid<br>
    >>> not null<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_client_connect_2] 237 check<br>
    >again:<br>
    >>> socket valid o<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_client_connect_2] 272<br>
    connected<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=36<br>
    >>> [2017/02/09 13:38:17:8177] ERR: [lws_client_socket_service] 144<br>
    >>> LWSCM_WSCL_ISSUE_HANDSHAKE<br>
    >>> [2017/02/09 13:38:17:8222] ERR: [lws_service_fd_tsi] 1143 goto<br>
    >handled<br>
    >>> [2017/02/09 13:38:17:8223] ERR: [lws_service_fd_tsi] 1143 goto<br>
    >handled<br>
    >>> [2017/02/09 13:38:17:8336] ERR: [lws_service_fd_tsi] 1140 call<br>
    >>> lws_client_socket_service<br>
    >>> [2017/02/09 13:38:17:8336] ERR: [lws_client_socket_service] 85<br>
    >>> wsi->mode=40<br>
    >>> [2017/02/09 13:38:17:8336] ERR: [lws_client_socket_service] 247<br>
    >>> LWSCM_WSCL_WAITING_SERVER_REPL<wbr>Y<br>
    >>> [2017/02/09 13:38:17:8338] ERR: [lws_client_socket_service]<br>
    315 call<br>
    >>> lws_client_interpret_server_ha<wbr>ndshake<br>
    >>> [2017/02/09 13:38:17:8339] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 470 http_response=101<br>
    >>> [2017/02/09 13:38:17:8339] ERR:<br>
    >[lws_client_interpret_server_<wbr>handshake]<br>
    >>> 864 set LWS_CALLBACK_CLIENT_FILTER_PRE<wbr>_ESTABLISH<br>
    >>> [2017/02/09 13:38:17:8339] ERR: [lws_service_fd_tsi] 1143 goto<br>
    >handled<br>
    >>> ws_callback: LWS_CALLBACK_CLIENT_FILTER_PRE<wbr>_ESTABLISH<br>
    >>> ws_callback: LWS_CALLBACK_CLIENT_ESTABLISHE<wbr>D<br>
    >>> [ws_callback] Connect with server success.<br>
    >>><br>
    >-----------------------------<wbr>------------------------------<wbr>-----------<br>
    >>><br>
    >>> Wayne<br>
    >>><br>
    >>><br>
    >>> ______________________________<wbr>_________________<br>
    >>> Libwebsockets mailing list<br>
    >>> <a href="mailto:Libwebsockets@ml.libwebsockets.org" target="_blank">Libwebsockets@ml.libwebsockets<wbr>.org</a><br>
    <mailto:<a href="mailto:Libwebsockets@ml.libwebsockets.org" target="_blank">Libwebsockets@ml.libwe<wbr>bsockets.org</a>><br>
    >>> <a href="https://libwebsockets.org/mailman/listinfo/libwebsockets" rel="noreferrer" target="_blank">https://libwebsockets.org/mail<wbr>man/listinfo/libwebsockets</a><br>
    <<a href="https://libwebsockets.org/mailman/listinfo/libwebsockets" rel="noreferrer" target="_blank">https://libwebsockets.org/mai<wbr>lman/listinfo/libwebsockets</a>><br>
    >>><br>
    >><br>
    >><br>
<br>
    --<br>
    Sent from my Android device with K-9 Mail. Please excuse my brevity.<br>
<br>
<br>
</blockquote>
<br>
</blockquote></div><br></div></div></div></div></div>