Http 400 Bad request

56 views
Skip to first unread message

Kubi

unread,
Apr 11, 2013, 6:08:01 PM4/11/13
to pyweb...@googlegroups.com
Hello,

Could you help me with my problem? I have installed pywebsocket on my apache server, it is running as apache extension (not standalone). I have problem with connecting to server from extern networks.
My server is slackware based and I tried to allow all incoming traffic with "iptables -P INPUT ACCEPT" (all outgoing traffic is allowed).
On my router, I have forwarded tcp and udp traffic on port 80 to my server.

This are browser headers (Firefox 18, FireBug)


##################################
###
### Server response and browser request from LOCAL network
###
### Response:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: HwptUR2FopEpOlVU8xZXPg1Em1U=

### Request:
GET /echo HTTP/1.1
Host: 192.168.1.1
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Sec-WebSocket-Version: 13
Origin: http://192.168.1.1
Sec-WebSocket-Key: 7LOcl8ZRfG3GmmyvZGTwXw==
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket


##################################
###
### Server response and browser request from EXTERN network
###
### Response:
HTTP/1.1 400 Bad Request
Date: Thu, 11 Apr 2013 20:35:50 GMT
Server: Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/1.0.1e DAV/2 mod_python/3.3.1 Python/2.7.3 PHP/5.3.22
Content-Length: 226
Content-Type: text/html; charset=iso-8859-1
X-Pad: avoid browser bug
Connection: keep-alive
### Request
GET /echo HTTP/1.1
Host: 88.212.xx.xx
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Sec-WebSocket-Version: 13
Origin: http://88.212.xx.xx
Sec-WebSocket-Key: d5YbCNDXgMSrhS+2/9BpdQ==
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket


What could be causing the problem? Do you think this could be issue with router or firewall? Or may it be that apache is not running pywebsocket extension on request from extern networks (different host)? Please advice how to investigate this. Thank you :)

Takeshi Yoshino

unread,
Apr 11, 2013, 11:41:37 PM4/11/13
to pyweb...@googlegroups.com
Can you how check the handshake request looks like at the server using tcpdump or something?

Does the same problem happen even if you use standalone mode? If it's allowed on your environment, please check if standalone mode works.


Takeshi



--
 
---
You received this message because you are subscribed to the Google Groups "pywebsocket" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pywebsocket...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kubi

unread,
Apr 12, 2013, 6:40:35 PM4/12/13
to pyweb...@googlegroups.com
Hello,

I've just tried standalone mode and it worked. That's great, but I'd like to integrate it to apache and not use standalone mode.
I attached a tcpdump I made ( tcpdump port 80 -A -w tcpdump.txt ). I tried to initialize connection twice from extern network using my android mobile and autobahn websocket library. (I was able to to connect to standalone server using android)

Kubi
tcpdump.txt

Kubi

unread,
Apr 15, 2013, 10:04:34 AM4/15/13
to pyweb...@googlegroups.com
Hello, have you found anything? Is there anything more I can try?

Thank you

Takeshi Yoshino

unread,
Oct 22, 2013, 3:28:57 AM10/22/13
to pyweb...@googlegroups.com
Anything output by pywebsocket?

If you specify
  LogLevel debug
in the Apache configuration file, you'll see the log of pywebsocket in the Apache error log (such as /var/log/apache2/error.log).

Takeshi


On Mon, Apr 15, 2013 at 11:04 PM, Kubi <jjt...@gmail.com> wrote:
Hello, have you found anything? Is there anything more I can try?

Thank you
Reply all
Reply to author
Forward
0 new messages