Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.
/ websockets-demo Public archive

Simple demo to demonstrate connecting to a dotnet core console app from javascript using websockets.

Notifications You must be signed in to change notification settings

forrestab/websockets-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Simple WebSockets Demo

This is a demo to test running a small socket server in a dotnet core console app and connecting to it via websockets from javascript.

Server

Based on https://github.com/paulbatum/WebSocket-Samples/blob/master/HttpListenerWebSocketEcho/Server/Server.cs

  • dotnet core console app
  • Uses System.Net.HttpListener (docs) and System.Net.WebSockets (docs)

Client

Based on https://codepen.io/matt-west/details/tHlBb

  • Simple html page with vanilla js
  • Uses the WebSocket api (docs)

Usage

Server

  1. Make sure Visual studio is running as an administrator
  2. Run console app

Client

  1. Run npm i
  2. Run npm run serve
  3. Type your message and click "Send" and you should see your message echoed back, both on the console and the site

About

Simple demo to demonstrate connecting to a dotnet core console app from javascript using websockets.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published