Skip to content

spg-puw/websocket_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Example for websockets

This example demonstrates how to use websockets. To learn more about websockets see the MDN.

Encryption

Please note the following from the MDN about websockets:

The URL to which to connect; this should be the URL to which the WebSocket server will respond. This should use the URL scheme wss://, although some software may allow you to use the insecure ws:// for local connections.

Server

The default configuration of the server runs locally (localhost) on port 8001.
To create a new websocket server with python or nodejs:

  • python: python3 server.py
  • nodejs: npm install && node server.js

Client

You can connect to the server via the js browser client. Just open the website client.html on your local computer. To test it in a simple project setting you can also launch a local webserver via python, node or php etc.

About

websocket demo; template for your own projects

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published