-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't get /web to connect to websocket on SSL (wss) #5
Comments
Can you show the browser's console log after opening the page? Anyway, I do not believe WSS will work. Sorry about that. |
You can look here, https://zyxep.net/ Shouldn't i get any response when the server is running ?
I don't even see anything when i connect to it with iocat
Even though there is activity on the server |
And i just changed it to ws:// same result.
|
No, the server won't log anything if the connection is refused. That is shown only in the browser console. I can't see the exact error you're getting since your page is pointed at 127.0.0.1, but I know that |
If you load your page with |
I just changed it to http and listening on external ip, no changes. |
That's about the limit of my knowledge on the subject, sorry. Perhaps you could try a new port. |
Can i enable debugging in your code some how? |
Perhaps you could add this on line wss.on('error', function(error) {
console.error(error);
}); |
I got it to work @vegeta897 :) but now my site us running d-zone :D |
@zyxep That's great to hear! Your server looks great :) |
It's not even my server :P but i did get permission to set it up on it. |
D-Zone is a heavily WIP project and also a collection of firsts for me as a developer. My implementation of websockets was the minimum for what I needed to get it working. If someone had sent a PR to add SSL support, I would have happily accepted it. But it simply hasn't been a priority for me. The rewrite I'm working on, on the other hand, will support SSL (and may require it, pending a design decision) since the bot client will be running in-browser. |
Update to anyone following this issue who may still care, D-Zone now supports SSL |
I'm reopening this because the way I implemented WSS is bad. I plan to do it in a way that works with reverse proxying. |
Tried to use both the v1/docker and heroku branches in a docker-container with nginx as a reverse proxy. The furthest I got was this. I was hoping simply pointing my reverse proxy at the container and it's port would work, but it sadly did not.
v1/docker branch:
What did work with both branches though, was setting an environment variable in docker with my bot token and running the update-config.js script. That's pretty nice. After setting everything up according to the guides, the container itself started throwing this error as well. In the end, I gave up. Looking forward to the day the rewrite is finished. I love the idea of d-zone. It's really awesome! Cheers, |
Thanks for the comment; I'm sorry you had to go through all that to no avail. Most of this stuff is over my head and I intend to get a firmer grasp of it all when we reach that point in the rewrite. Hope to see you again later! |
Happy to provide logs and some such. If you need help in the future with testing, then gimme a ping and I'll see what I can do. Good luck and see you later. 😃 |
Holy crap. I got it to work!
Or using my image on DockerHub You can deploy D-Zone with docker-compose as follows:
If you are using a dockerized nginx, this config may help you out. It works for me and the nginx conainer I am running:
You also need to exec into the container and edit the
A working example can be viewed at https://phoenixorden.griefed.de |
Wow, nice work! Couple things I'm wondering:
|
|
Yes, with your configuration you don't want to run in secure mode since you want the WS server to be non-secure while your nginx config handles the SSL. Looking at the heroku branch again, the update-config script is definitely not used. The discord-config.json has an |
Yup. Updated the descriptions and the image as well. Thanks for your input and sorry for the whole back and forth because of something that didn't even need to be there from the beginning 😀 |
Hi,
I have pointed my nginx web server to point to the /web folder, and i have changed the connection to be a WSS: but it won't connect on localhost.
any clue?
The text was updated successfully, but these errors were encountered: