Jump to content


  • Posts

  • Joined

  • Last visited

hhdavidh's Achievements


Newbie (1/14)



  1. Does it work if you add the (.*) like Tommygun did? I've now changed it to: RewriteEngine On RewriteRule "^Server/(.*)" "ws://localhost:8080/hhdavidh_Hide/Server/ANY" [P,L] ...however, it still doesn't work. I should say that the reason my .htaccess looks different to his is that firstly I have tried doing a near copy (apart from necessary adjustments) of his .htaccess file however that still didn't work. And secondly, I tried teaching myself the rules of writing in the .htaccess file yesterday, and from what I've learned I think my .htaccess file should work regardless. I've also removed the RewriteConds so as to not over-complicate it if I make a mistake.
  2. Firstly, VPSes aren't really an option for me at the moment as I'm not able to put money into this until after I finished my game/website. Also since I didn't want to use WSS anyway, I've done more research on WS, Apache, .htaccess and using Apache as a proxy. And from what I've learned and from tommygun's post, I've made the following changes: Client (Javascript): const Connection = new WebSocket("ws://hhdavidh.heliohost.org/Server/ANY"); .htaccess File: RewriteEngine On RewriteRule "^/Server/ANY$" "ws://localhost:8080/hhdavidh_Hide/Server/ANY" [P,L] Server (Java): @ServerEndpoint("/Server/{ServerID}") All of this results in the same error: WebSocket connection to 'ws://hhdavidh.heliohost.org/Server/ANY' failed: Error during WebSocket handshake: Unexpected response code: 404On a side note, if I change the .htaccess file to this (as I found in some forums): RewriteEngine On RewriteRule "^/Server/ANY$" "ws://localhost:8080/hhdavidh_Hide/Server/ANY" [P,L] ProxyPass http://localhost:8080/ ...then the error changes to this: WebSocket connection to 'ws://hhdavidh.heliohost.org/Server/ANY' failed: Error during WebSocket handshake: Unexpected response code: 500 Now, regardless if I leave ProxyPass in or out, I still don't know how to replicate tommygun's "non-encrypted websocket chatter". Do you have any more ideas on what I can change or add? This is all new to me so any help would be appreciated.
  3. There is a post on these forums that is quite similar to the problem I have: https://www.helionet.org/index/topic/29870-java-websocket-on-tommy-default-ports-debugging-general-help/ ...tommygun got a websocket working on Helio, however, there was no mention of a VPS for the websocket to work. Now, I've tried my best to apply the steps tommygun provided in that post, but I'm still having trouble. So I guess my question is 'How would you create a basic websocket connection using a WAR file, and what would be the correct URL for it?'.
  4. I still get an error: WebSocket connection to 'ws://hhdavidh.heliohost.org:1234/hhdavidh_Hide/Server/ANY/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT Assuming my war file is now called "hhdavidh_Hide.war" what part of this (below) URL should I change for it to be correct? ws://hhdavidh.heliohost.org:1234/hhdavidh_Hide/Server/ANY/ Also, I have seen people have their URLs without a port number (:1234). If that's the problem I have, then what port number should my server-side code use?
  5. WebSocket connection to 'ws://hhdavidh.heliohost.org/Hide/Server/ANY' failed: Error during WebSocket handshake: Unexpected response code: 404
  6. Yeah, that's what I thought so I tried other port numbers (sorry, I should have made that more clear), but they all still gave the same error.
  7. Hello I've finally been granted Java support on my account, and so today I tried to test out my website/game on it. I'm very new to websites, domains, etc. so my knowledge of all this is limited. That being said I've worked on my website/game for a while now, and I know it works as I have tested it on my computer. My game uses a websocket from the client side to connect to the Java websocket endpoint. I use: new WebSocket("ws://localhost:443/Hide/Server/ANY") ...on the client side to do this. "localhost" is used because this is being tested on Tomcat on the same computer; "443" because while I can set this to any number (which I have tested), it seems like the best port I could use for a non-secured connection; "Hide" is the project folder name; "Server/ANY" is the server endpoint. I've tested this many times and it works. Now to move the project/WAR file (WAR file is called "Hide-1.war") to HelioHost, I first changed the Websocket URL to: new WebSocket("ws://hhdavidh.heliohost.org/Hide/Server/ANY") I then uploaded the WAR file and deployed it. However, when I go to the URL where it's deployed at (http://hhdavidh.heliohost.org/Hide-1/) I get: WebSocket connection to 'ws://hhdavidh.heliohost.org/Hide/Server/ANY' failed: Error during WebSocket handshake: Unexpected response code: 404 I've tried port "8080" as well as other port numbers. I've tried changing the websocket URL to: new WebSocket("ws://hhdavidh.heliohost.org/Hide-1/Server/ANY") new WebSocket("ws://hhdavidh.heliohost.org/Server/ANY") new WebSocket("ws://hhdavidh.heliohost.org:8080/Hide/Server/ANY") ... ...which all come up with the same error. When trying: new WebSocket("ws://hhdavidh.heliohost.org:443/Hide/Server/ANY") ...the error is instead: WebSocket connection to 'ws://hhdavidh.heliohost.org:443/Hide/Server/ANY' failed: Connection closed before receiving a handshake response I've tried everything I can think of but now I'm stuck. Any help is appreciated!
  • Create New...