Access Client Info (IP/Port) from Client Side
Open
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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