Comparing version 6.6.0 to 6.6.1
{ | ||
"name": "eiows", | ||
"version": "6.6.0", | ||
"version": "6.6.1", | ||
"description": "custom fork of uWebSockets 0.14", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -15,18 +15,11 @@ eiows is a replacement module for ws which allows, but doesn't guarantee, significant performance and memory-usage improvements. This module is specifically only compatible with Node.js. | ||
If you use engine.io version 5.0.0 or higher: | ||
// ESM | ||
import * as http from 'http'; | ||
import { Server } from "socket.io"; | ||
import { eiows } from 'eiows'; | ||
var fs = require('fs'); | ||
var https = require('https'); | ||
let server = http.createServer(); | ||
var ssl_options = { | ||
key: fs.readFileSync('server.key'), | ||
cert: fs.readFileSync('server.crt'), | ||
}; | ||
var server = https.createServer(ssl_options); | ||
server.listen(1443); | ||
var io = require("socket.io")(server, { | ||
wsEngine: require("eiows").Server, | ||
let io = new Server(server, { | ||
wsEngine: eiows.Server, | ||
perMessageDeflate: { | ||
@@ -37,22 +30,13 @@ threshold: 32768 | ||
io.on("connection", function(socket) { | ||
io.on("connection", () => { | ||
console.log('Yes, you did it!'); | ||
}); | ||
server.listen(8080); | ||
If you use engine.io version 3.4.2 till version 5.0.0: | ||
// CJS | ||
var http = require('http'); | ||
var server = http.createServer(); | ||
var fs = require('fs'); | ||
var https = require('https'); | ||
var ssl_options = { | ||
key: fs.readFileSync('server.key'), | ||
cert: fs.readFileSync('server.crt'), | ||
}; | ||
var server = https.createServer(ssl_options); | ||
server.listen(1443); | ||
var io = require("socket.io")(server, { | ||
wsEngine: 'eiows', | ||
wsEngine: require("eiows").Server, | ||
perMessageDeflate: { | ||
@@ -66,3 +50,4 @@ threshold: 32768 | ||
}); | ||
server.listen(8080); | ||
Have fun! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
104877
51