Skip to content

Access Client Info (IP/Port) from Client Side #227

@jogibear9988

Description

@jogibear9988

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions