WebFaction
Community site: login faq

Hello,
I have written a Tornado Chat server on webfaction that listens on port 42178 (Custom App) - vikeshkhanna.webfactional.com

The client side of the application uses javascript websockets to open persistent TCP connections with the server. Whereas, the server is running fine, the client is not able to open sockets with the server. Here is my JS code -

  $(document).ready(function() {
                     ws = new WebSocket("ws://216.12.215.196:42178/socket?username='{{username}}'");

                    ws.onmessage = function(event){
                            $('#chat-area').append(event.data + '<br />');
            }});

The IP address in the code above is the secondary IP address opened for port 42178 (on request). My server prints on console whenever a new socket is opened, which is just not happening. Clearly, the server is not receiving the request. [Running fine on localhost].

Settings on my control panel -
Domain - vikeshkhanna.webfactional.com
Application - tornado_chat [Custom App listenting on a port - 42178]
Website - tornado_chat [ IP : 216.185.102.18 - NOTE that this is the primary shared IP; Subdomain - vikeshkhanna.webfactional.com]

What is going wrong here?

Thanks,
Vikesh

asked 02 Apr '12, 06:13

Vikesh Khanna
112
accept rate: 0%

edited 02 Apr '12, 06:13


You can't access your port directly on the server's primary shared IP address.

If you need direct access to your port, then we can activate a secondary shared IP for your account and open your port there.

If you'd like us to do that, then please open a support ticket to request it (if you haven't done so already).

Hope that helps!

permanent link

answered 02 Apr '12, 11:58

seanf
12.2k41836
accept rate: 37%

Thanks seanf. Yes, I have already got the port opened on the secondary IP address and that's the IP I am using in the JS code above. But the Tornado server is still configured to run on the primary address (from the Control Panel - please read the details in the question). I am still not able to open the websocket.

(02 Apr '12, 13:50) Vikesh Khanna

Apologies, I did miss the bit about the secondary IP.

I'm able to connect to 216.12.215.196:42178 via telnet, so the port is definitely open and your server is definitely listening.

I tried visiting your site at vikeshkhanna.webfactional.com but it serves a 500 error, and I'm not able to find a log file for your Tornado app. Do you have any indication of what the 500 error is?

(02 Apr '12, 18:32) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×27
×23
×11

question asked: 02 Apr '12, 06:13

question was seen: 3,860 times

last updated: 02 Apr '12, 18:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM