sta / sta/websocket-sharp

Could be possible to allow Regular expressions for path in Service add method?

Open
#239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

In WebSocketServer, could be useful to have a method AddWebSocketService with path argument as a regular expression.

In this way a set of request url could be managed by the same WebSocketBehavior.

Something like what Owin.Websocket does in the following code.

using Owin.WebSocket.Extensions;

//For dynamic routes where you may want to capture the URI arguments use a Regex route
app.MapWebSocketPattern<MyWebSocket>("/captures/(?<capture1>.+)/(?<capture2>.+)");

What do you think about this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading WebSocketServer and the AddWebSocketService method referenced in the issue, then compare the linked Owin.WebSocket pattern-routing example. Determine how regular-expression paths and captured URI values should reach a WebSocketBehavior. Done means the API and routing behavior are specified and covered for matching and non-matching request URLs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.