https://github.com/tomashubelbauer/net-core-web-socket-server
A demonstration of how to build a simple web socket server in .NET Core
https://github.com/tomashubelbauer/net-core-web-socket-server
net-core web-sockets
Last synced: 5 months ago
JSON representation
A demonstration of how to build a simple web socket server in .NET Core
- Host: GitHub
- URL: https://github.com/tomashubelbauer/net-core-web-socket-server
- Owner: TomasHubelbauer
- Created: 2019-05-13T14:16:34.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-04-14T20:34:21.000Z (over 3 years ago)
- Last Synced: 2025-08-03T03:43:42.446Z (5 months ago)
- Topics: net-core, web-sockets
- Language: C#
- Homepage: https://tomashubelbauer.github.io/net-core-web-socket-server
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# .NET Core WebSocket Server
This repository demonstrates how to use the legacy `HttpListener` API to build a
naive WS server capable of accepting both text and binary connections from a JS
client running in a web browser.
To run the server, run `dotnet script main.csx`. You need `dotnet script` which
you can install by running `dotnet tool install -g dotnet-script`.
To run the client, open `index.html` and then use the developer tools to issue
a call of either `pingText` or `pingBinary` to see the echo.
This repository exists to demonstrate the WebSocket message preview capabilities
of the Google Chrome developer tools. I am however unable to demonstrate viewing
an outgoing binary frame, the content appears to be empty and the length is
mistakenly shown to be zero bytes. Incoming binary message is previewed
correctly.
I posted [a Stack Overflow question](https://stackoverflow.com/q/56114835/2715716)
inquiring about what could be the cause of the broken web socket frame display
in Chrome developer tools.
I made [a Chrome bug](https://crbug.com/962857) for this as well.
This turned out to be a Chrome bug as per the linked CRbug.