Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active September 5, 2022 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/fe7da5101124de0a011abfca6e452097 to your computer and use it in GitHub Desktop.
Save bjoerntx/fe7da5101124de0a011abfca6e452097 to your computer and use it in GitHub Desktop.
// serve static linked files (JavaScript and CSS for the editor)
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new Microsoft.Extensions.FileProviders.PhysicalFileProvider(
System.IO.Path.Combine(System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location),
"TXTextControl.Web")),
RequestPath = "/TXTextControl.Web"
});
// enable Web Sockets
app.UseWebSockets();
// attach the Text Control custom WebSocketHandler middleware
app.UseMiddleware<CustomWebSocketMiddleware>("127.0.0.1", 4279);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment