Skip to content

Marlineck/ddev-websocket-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is an experimental DDEV + websocket demo from https://stackoverflow.com/questions/74206517/ddev-how-to-etablish-websocket-connections and http://socketo.me/docs/hello-world

To use:

Example Javascript call on browsers console:

var conn = new WebSocket('wss://ddev-websocket-demo:3001'); conn.onopen = function(e) { console.log("Connection established!"); }; conn.onmessage = function(e) { console.log(e.data); };

You will see the console message "Connection established!" when the websocket connection in successful. Check also your ddev terminal and see the connection message here. You can start sending messages to other connected browsers:

conn.send('Hello World!');

About

Simple experimental demonstration of websocket demo from https://stackoverflow.com/questions/74206517/ddev-how-to-etablish-websocket-connections and http://socketo.me/docs/hello-world

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%