Hook up close, drain, compression, "Neuter" ArrayBuffers on return
This commit is contained in:
parent
15684984d9
commit
647b55f5d8
2 changed files with 85 additions and 24 deletions
|
@ -3,21 +3,26 @@ var uWS = uWS ? uWS : require('../dist/uws.js');
|
|||
|
||||
const port = 9001;
|
||||
|
||||
// nice milestone to pass autobahn on both ssl and non-ssl with an without compression
|
||||
|
||||
const app = uWS.SSLApp({
|
||||
const app = uWS./*SSL*/App({
|
||||
key_file_name: '/home/alexhultman/key.pem',
|
||||
cert_file_name: '/home/alexhultman/cert.pem',
|
||||
passphrase: '1234'
|
||||
}).get('/hello', (res, req) => {
|
||||
res.end('Hejdå!');
|
||||
}).ws('/*', {
|
||||
compression: 0,
|
||||
maxPayloadLength: 16 * 1024 * 1024,
|
||||
open: (ws, req) => {
|
||||
console.log(ws);
|
||||
},
|
||||
message: (ws, message, isBinary) => {
|
||||
ws.send(message, isBinary);
|
||||
},
|
||||
drain: (ws) => {
|
||||
console.log('WebSocket drained');
|
||||
},
|
||||
close: (ws, code, message) => {
|
||||
console.log('WebSocket closed');
|
||||
}
|
||||
}).listen(port, (token) => {
|
||||
if (token) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue