sta / sta/websocket-sharp

Access Client Info (IP/Port) from Client Side

Open
#227 1 comment 4 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

If I implement a Websocket Server, I can log the Client Info via "context.UserEndpoint...". On CLient Side, I also wanted to log the Port wich was used, but I can only do via reflection:

 var tcpc = socket.GetType().GetField("_tcpClient", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(socket) as TcpClient;
        var p = ((IPEndPoint)tcpc.Client.LocalEndPoint).Port;

Maybe this can be made accessible in some way?

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 examining the client-side socket object and the private _tcpClient/LocalEndPoint path shown in the report. Determine an appropriate public way for client code to access the local port, then verify that the port can be read without reflection; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.