sveinung wrote:
I've currently gotten to a point were my web browser complains that "WebSocket connection to 'ws://localhost/civsocket' failed: Error during WebSocket handshake: Unexpected response code: 404" while
http://localhost:7002/status says "Process status: OK". Any suggestion about what log or config file I should look at?
"WebSocket connection to ... failed" indicates that there was a connection error between the WebSocket client in your browser and the WebSocket server running in Freeciv-proxy. 404 indicates that the URL was incorrect. The WebSocket URL should be ws://localhost/civsocket/7002. My best guess is that the freeciv-web webapplication is not updated, or the nginx configuration. Pull the latest code from github, then build the different components in the order described
here.
I have improved the
status-freeciv-web.sh script to check for more things. Could you pull this from git and post the output? The output should look like this:
Code: Select all
Checking that Freeciv-web is running correctly...
checking nginx on http://localhost
nginx OK!
--------------------------------
checking resin on http://localhost:8080/
resin OK!
--------------------------------
checking freeciv-proxy directly on http://localhost:7001/status
freeciv-proxy OK!
--------------------------------
checking freeciv-proxy through nginx on http://localhost/civsocket/7001/status
freeciv-proxy OK!
--------------------------------
testing WebSocket connection directly to Tornado
This should show "HTTP/1.1 101 Switching Protocols" and then timeout after 2 seconds.
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: KXGdZMoi2440O31GaOAuKsZfThY=
testing WebSocket connection through nginx
This should show "HTTP/1.1 101 Switching Protocols" and then timeout after 2 seconds.
HTTP/1.1 101 Switching Protocols
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 09 Sep 2014 16:55:09 GMT
Connection: upgrade
Upgrade: websocket
Sec-WebSocket-Accept: KXGdZMoi2440O31GaOAuKsZfThY=
--------------------------------
checking freeciv-web / publite2
freeciv-web OK!
--------------------------------
checking that webclient.min.js has been generated...
webclient.min.js is OK!
--------------------------------
checking that tileset has been generated...
tileset is OK!
--------------------------------
checking metaserver...
metaserver is OK!
--------------------------------
Check of Freeciv-web is done!
Also, could you please open the Javascript Console in your browser, and press Alt D as this will print some debug information to the console. This is what it looks like for me:
Code: Select all
Freeciv version: +Freeciv.Web.Devel-2.6 tracker.js:10
Browser useragent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36 tracker.js:10
jQuery version: 2.1.2-pre 995f70777ac6c0f988a44807ef1399e73937b2ee tracker.js:10
jQuery UI version: 1.11.1 tracker.js:10
simpleStorage version: 0.1.2 tracker.js:10
savegame count: undefined tracker.js:10
Touch device: false tracker.js:10
HTTP protocol: https: tracker.js:10
Network PING average (server): NaN ms. (Max: 0ms.) tracker.js:10
Network PING average (client): NaN ms. (Max: 0ms.) tracker.js:10
mozDash support: false
It would also be useful if you could start a new game in Google Chrome while running the developer tools.
Then go to "Network", and show me the output of the /civclientlauncher and /civsocket URLS there.
/civclientlauncher in Chrome. Note the response header called 'port' which is 6007. This will tell the client to connect to /civsocket/7007 using WebSockets, where nginx will proxy this request to a Freeciv-proxy server running on localhost:7007/civsocket, which will connect to a Freeciv C server on port 6007.
/civsocket/7007 in Chrome
Basically, this is why I like setting up the build environment automatically with Vagrant. It should be very easy. Perhaps you could try that again, maybe it is faster now?
I hope this helps!