[Libwebsockets] lwsts[7873]: ****** ec017ca0 Sending new, pending truncated ...

Andy Green andy at warmcat.com
Tue Jun 14 22:47:01 CEST 2016



On June 15, 2016 1:00:18 AM GMT+08:00, satya gowtham kudupudi <satyagowtham.k at gmail.com> wrote:
>I'm making http request to libwebsocket server using raw sockets.
>I'm sending below headers
>
>"POST /index.html HTTP/1.1\r\n"
>"User-Agent: myagent\r\n"
>"Content-Type: text/json; charset=utf-8\r\n"
>"Host: myhost\r\n"
>"Content-Length: " + ccl + "\r\n"
>"Connection: Keep-Alive\r\n\r\n"
>
>Response I got is "Forbidden request"

There are two ways to literally get "Forbidden", which is 403 response code

1) Unknown method, or something illegal about what is supposed to be urlencoded uri args.  So % followed by non-hex chars, % and less than 2 chars remaining, ? inappropriately etc

2) url after method didn't begin with /

If 1), it will log "forbidding on uri sanitation"

>I think the mistake is in User-Agent header field. Please help me.

Crank up the debug level to 65535 and look at the logs, it should show in detail where the parsing stops.

-Andy

>Regards
>Gowtham
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list