# Websocket causes "client sent invalid method."

**URL:** <https://www.ruby-forum.com/t/websocket-causes-client-sent-invalid-method/242537>\
**Category:** NGINX\
**Created:** [July 1, 2015, 5:09am UTC](https://www.ruby-forum.com/t/websocket-causes-client-sent-invalid-method/242537 "2015-07-01T05:09:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [July 1, 2015, 5:09am UTC](https://www.ruby-forum.com/t/websocket-causes-client-sent-invalid-method/242537/1 "2015-07-01T05:09:37Z")

</div>

Hello,

I’m trying setup nginx for socket proxy. I was able to find that nginx  
can  
be configured to proxy websockets and added an error log file in the  
server  
configuration block to isolate the messages, and I get:

client sent invalid method while reading client request line, client:  
XX.XX.XX.1, server: , request: ҁb▒▒"

in the access logs I see:

XX.XX.XX.1 - - [30/Jun/2015:17:39:15 -0400]  
“\x00\x08\x1B\x19\x94\xD2\x81b\xBD\xF3” 400 172 “-” “-” “-”

The software that is I need to proxy is a remote assistant application  
with  
a web servlet running inside tomcat and with two client applications,  
one  
admin and one user, that connect to the server and communicate.

Is there anything that can be done to make it work?

Thank you in advance.

Posted at Nginx Forum:

> **[websocket causes "client sent invalid method ..."](https://forum.nginx.org/read.php?2,260007,260007#msg-260007)**
>
> Hello, I'm trying setup nginx for socket proxy. I was able to find that nginx can be configured to proxy websockets and added an error log file in the server configuration block to isolate the messages, and I get: client sent invalid method while...

---

<div class="post-metadata">

**Author:** ![snagytx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c6cbf5/32.png) [@snagytx](https://www.ruby-forum.com/u/snagytx)\
**Post date:** [July 4, 2015, 7:20am UTC](https://www.ruby-forum.com/t/websocket-causes-client-sent-invalid-method/242537/2 "2015-07-04T07:20:52Z")

</div>

Hello!

On Tue, Jun 30, 2015 at 11:08:36PM -0400, snagytx wrote:

> XX.XX.XX.1 - - [30/Jun/2015:17:39:15 -0400]  
> “\x00\x08\x1B\x19\x94\xD2\x81b\xBD\xF3” 400 172 “-” “-” “-”
> 
> The software that is I need to proxy is a remote assistant application with  
> a web servlet running inside tomcat and with two client applications, one  
> admin and one user, that connect to the server and communicate.
> 
> Is there anything that can be done to make it work?

The “websocket proxy” is something completely different from what  
you are looking for. It’s to proxy the Websocket protocol  
connections - that is, to proxy HTTP/1.1 requests with protocol  
upgrade.

To proxy arbitrary stream sockets, use the stream module. See  
here for details:

> **[Module ngx\_stream\_core\_module](http://nginx.org/en/docs/stream/ngx_stream_core_module.html)**

Note that it’s only available in nginx 1.9.x.

–  
Maxim D.

> **[nginx](http://nginx.org/)**

---

<div class="post-metadata">

**Author:** ![snagytx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c6cbf5/32.png) [@snagytx](https://www.ruby-forum.com/u/snagytx)\
**Post date:** [July 6, 2015, 3:02pm UTC](https://www.ruby-forum.com/t/websocket-causes-client-sent-invalid-method/242537/3 "2015-07-06T15:02:19Z")

</div>

Thank you. As a temporary solution I used port-forwarding at the  
firewall  
level, it doesn’t do load balancing but I don’t need it for now.

Posted at Nginx Forum:

> **[Re: websocket causes "client sent invalid method ..."](https://forum.nginx.org/read.php?2,260007,260083#msg-260083)**
>
> Hello, I'm trying setup nginx for socket proxy. I was able to find that nginx can be configured to proxy websockets and added an error log file in the server configuration block to isolate the messages, and I get: client sent invalid method while...
