Search code examples
c#websocket-sharp

determine the IP Adress which is used to connect to a websocket server (websocket-sharp)


I have a linux machine, with multiple ip-adresses configured. I create a connection with the following code.

        ws = new WebSocket(Adress);
        ws.Origin = Origin;

        ws.OnOpen += OnOpen;
        ws.OnError += OnError;
        ws.OnMessage += OnMessageReceived;
        ws.OnClose += OnClose;

        ws.ConnectAsync();

This works all fine, but how can i determine the ip adress, which websocket-sharp is using to connect to a server?


Solution

  • To set the local adress you have to modify the websocket-sharp library, because this functionality isn't supported right now.