-
Notifications
You must be signed in to change notification settings - Fork 707
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
Add option to run server over HTTPS #631
Conversation
@c-w Thanks so much for this! Do you think it would make sense to also include the Koa apps in this as well? Currently we run the Lobby and API servers using Koa’s These use Let me know what you think, and if it’s too much for this PR, I’ll get this merged and we can add it to the to-do list. |
@delucis Thanks for the review. I definitely also want to include the Koa apps in the HTTPS setup. My initial implementation of this feature actually was very similar to your suggestions, namely a refactor of the The code I pushed to the pull request doesn't make this setup obvious and we technically have no guarantee that any transport implementation provided by a caller maintains the invariant that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes and clear explanation. Looks good. I’ve requested a couple of tiny changes, and then I think this should be good to go.
Thanks Clemens! Especially for including the documentation update with this. |
Thanks for the merge! Any chance I could get a patch release for this too? I'm using this feature on a game I'm working on currently and would love to remove my local package override hack. |
@nicolodavis is managing the release flow, but I’ll ask! |
Will release this soon. Let me also point out that NPM supports GitHub installs so it's very easy to just do:
and get the latest code rather than waiting for an official NPM package (I haven't tested this on boardgame.io specifically so someone would need to test if it pulls in dependencies correctly). |
This commit adds the option to run the boardgame.io server over HTTPS by passing through koa-socket-2 SSL options to the SocketIO transport.
While it's also possible to achieve HTTPS in other ways, e.g. via nginx as discussed in #322, enabling first-party support for HTTPS makes it much simpler to spin up such services since it removes the need to install and configure an external SSL terminator and proxy.
Checklist
master
).