Comments (4)
Got it working here:
//socket-config.json
//using letsencrypt
{
"address": "my.address",
"port": "1338",
"ssl-key": "/some/path/privkey.pem",
"ssl-cert": "/some/path/cert.pem"
}
// script/websock.js
let fs = require('fs');
module.exports = WebSock;
let http = require('https');
function WebSock(config, onConnect, onJoinServer) {
let opts = {
secure: true,
key: fs.readFileSync(config.get('ssl-key')),
cert: fs.readFileSync(config.get('ssl-cert'))
};
let server = http.createServer(opts, (req, res) => {});
server.listen(config.get('port'), () => {});
var WSServer = require('ws').Server;
var wss = new WSServer({server});
//etc...
}
//web: main.js
var WebSocket = require('websocket-stream');
ws = WebSocket('wss://'+socketConfig.address+':'+socketConfig.port);
URL: https://jmtk.co/dzone/?s=L
Lemme know if this is a good solution and I can do a PR
from d-zone.
You can see a copy of it running on TLS here: https://zulu.tacocat.org/dzone
from d-zone.
This is cool! I'll have to check it out!
from d-zone.
I have implemented a solution similar to @JMTK's on the . Configuration is as simple as setting eris
branchsecure
to true
in socket-config.json
and defining the paths to your cert and key files with environment variables (or .env file).
This branch will be merged with main after a few days, when I've decided everything is working okay. Everything's cool and it's merged now.
from d-zone.
Related Issues (20)
- Discussion about Default Database Plugin and Implementation HOT 5
- Yakshaving takes already-initialized plugins even when not used HOT 1
- Light background overhaul HOT 1
- TypeError: Cannot convert undefined or null to object
- Peer dependencies do not work
- Invalid file path format - Peer dependencies support HOT 3
- TypeError: Cannot read property 'get' of undefined HOT 6
- Move to NEXT.js? HOT 4
- Support Traditional Chinese HOT 3
- Single-channel Chat Focus HOT 2
- Use PixiJS modules
- The server is not ready yet, try again shortly. HOT 4
- Bot doesn't start HOT 2
- Document bot permissions necessary HOT 1
- Option to hide users (bots) HOT 8
- D-zone in a network with variable IP HOT 3
- Custom map support? HOT 1
- Improve server list config HOT 1
- Add chat commands for server configuration HOT 2
- Dockerized d-zone HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d-zone.