Skip to content

mattieruth/simple-ws-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-ws-server

This repo has two things:

  1. basic-server.js: Implements a very. basic. websocket server and prints any message it gets as well as when there's a new connection or a connection is closed

  2. basic-client.html: A very. basic. webpage that:

    1. connects to the websocket on 'load'
    2. sends a last message and closes the websocket on 'unload' or 'beforeunload' (your choice based on what you've got uncommented :) )

running

run the server

npm i
npm run serve

run the client

  1. open /path/to/basic-client.html in the browser of choice
  2. open the console and be sure to have it set to preserve logs
  3. try refreshing/navigating away/closing the tab and watching the output in the server to see when unload/beforeunload succeeds

results

On 10.14.21, here were the results of this test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published