[Libwebsockets] client / method=HEAD

Joel Winarske joel.winarske at gmail.com
Mon Mar 13 19:30:56 CET 2017


I gave it a spin.  Based on the Wireshark trace below, one can see why "no
ACCEPT".  It just needs to get to LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH.


[2017/03/13 11:21:07:9396] NOTICE:      url: http://www.npr.org
[2017/03/13 11:21:07:9396] NOTICE:      method: HEAD
[2017/03/13 11:21:07:9396] NOTICE: using http mode (non-ws)
[2017/03/13 11:21:07:9396] NOTICE: http client: connecting
[2017/03/13 11:21:07:9396] INFO: lws_header_table_attach: wsi 038C4198: ah
00000000 (tsi 0, count = 2) in
[2017/03/13 11:21:07:9396] INFO: lws_header_table_attach: wsi 038C4198: ah
01313DF8: count 3 (on exit)
[2017/03/13 11:21:07:9396] NOTICE: lws_client_connect_2: address www.npr.org
[2017/03/13 11:21:08:0230] INFO: lws_client_connect_via_info: created child
038C4198 of parent 038C3E70
[2017/03/13 11:21:08:0230] NOTICE: lws_client_connect_via_info sucessful
[2017/03/13 11:21:08:0230] INFO: lws_read: read_ok, used 157
[2017/03/13 11:21:08:0937] NOTICE: lws_client_connect_2: address www.npr.org
[2017/03/13 11:21:08:1668] INFO: no ACCEPT
[2017/03/13 11:21:08:1668] INFO: closing connection due to bail2 connection
error
[2017/03/13 11:21:08:1668] INFO: lws_close_free_wsi: real
just_kill_connection: 038C4198 (sockfd 576)
[2017/03/13 11:21:08:1668] INFO: remove_wsi_socket_from_fds: removing same
prot wsi 038C4198
[2017/03/13 11:21:08:1678] INFO: ah det due to close


[Wireshark trace]
Frame 61: 324 bytes on wire (2592 bits), 324 bytes captured (2592 bits) on
interface 0
Ethernet II, Src: IntelCor_c7:3f:74 (24:77:03:c7:3f:74), Dst:
Cisco_51:82:94 (00:78:88:51:82:94)
Internet Protocol Version 4, Src: 172.16.19.129, Dst: 38.68.171.71
Transmission Control Protocol, Src Port: 29415, Dst Port: 80, Seq: 1, Ack:
1, Len: 270
Hypertext Transfer Protocol
    GET // HTTP/1.1\r\n
    Pragma: no-cache\r\n
    Cache-Control: no-cache\r\n
    Host: www.npr.org\r\n
    Upgrade: websocket\r\n
    Connection: Upgrade\r\n
    Sec-WebSocket-Key: sxJNyEO7i6YfA1p9CTglHw==\r\n
    Sec-WebSocket-Protocol: http\r\n
    Sec-WebSocket-Extensions: permessage-deflate\r\n
    Sec-WebSocket-Version: 13\r\n
    \r\n
    [Full request URI: http://www.npr.org//]
    [HTTP request 1/1]


On Sun, Mar 12, 2017 at 11:05 AM, Andy Green <andy at warmcat.com> wrote:

>
>
> On March 12, 2017 10:27:33 PM GMT+08:00, Joel Winarske <
> joel.winarske at gmail.com> wrote:
> >Just for http client.  I see it for being used as a technique to test
> >the
> >internet connection.
>
> I haven't tried it, but it should generally work.  It doesn't understand
> itself atm that with HEAD, the content-length it was told is never going to
> be fulfilled.  So you may have to hang up on it after you got the headers.
>
> -Andy
>
> >
> >On Sat, Mar 11, 2017 at 1:30 PM Andy Green <andy at warmcat.com> wrote:
> >
> >>
> >>
> >> On March 12, 2017 2:14:46 AM GMT+08:00, Joel Winarske <
> >> joel.winarske at gmail.com> wrote:
> >> >Hi Andy,
> >> >
> >> >Is method HEAD expected to work with client?
> >>
> >> It looks like it should issue what it would for GET with HEAD, if you
> >set
> >> the client connect info .method to "HEAD".  That's what HEAD is
> >supposed to
> >> do on client.
> >>
> >> Are you really asking does lws server part understand HEAD?  It knows
> >it
> >> is a valid method and can parse it, but it doesn't respond to it
> >using HEAD
> >> semantics in the fileserving part, since nobody has asked for it.
> >>
> >> -Andy
> >>
> >> >
> >> >Joel
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20170313/24269e57/attachment-0002.html>


More information about the Libwebsockets mailing list