Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Server = require('simple-websocket/server')
- const server = new Server({port: 8181})
- new Promise((resolve, reject) => {
- server.on('connection', function(socket, request) {
- resolve({socket, request})
- })
- }).then(data => {
- console.log(data)
- })
- const Socket = require('simple-websocket')
- exports.test = function() {
- const socket = new Socket('wss://localhost:8181')
- socket.on('connect', function() {
- console.log('yes')
- })
- }
- WebSocket connection to 'wss://localhost:8181/' failed: Error in connection
- establishment: net::ERR_SSL_PROTOCOL_ERROR
- bundle.js:6106 Uncaught Error: connection error to wss://localhost:8181
- at WebSocket.Socket.self._ws.onerror (bundle.js:6106)
- Socket.self._ws.onerror @ bundle.js:6106
- error (async)
- Socket @ bundle.js:6105
- exports.test @ bundle.js:2841
- 9../middleware-comms/Listen @ bundle.js:2836
- o @ bundle.js:1
- r @ bundle.js:1
- (anonymous) @ bundle.js:1
Add Comment
Please, Sign In to add comment