Add UpgradeAsync example, update examples

This commit is contained in:
Alex Hultman 2020-06-05 17:09:19 +02:00
parent d1a2556fba
commit 369b4a551f
6 changed files with 93 additions and 13 deletions

View file

@ -35,8 +35,8 @@ const app = uWS./*SSL*/App({
/* We need a slightly higher timeout for this crazy example */
idleTimeout: 60,
/* Handlers */
open: (ws, req) => {
console.log('A WebSocket connected via URL: ' + req.getUrl() + '! Pushing data now!');
open: (ws) => {
console.log('A WebSocket connected!');
/* We begin our example by sending until we have backpressure */
while (ws.getBufferedAmount() < backpressure) {
ws.send("This is a message, let's call it " + messageNumber);