我将WebSocketSharp
的客户端与SSL
一起使用,如下所示:
var uri = $"wss://{_ip}:{_port}/";
websocketSec = new WebSocketSharp.WebSocket(uri);
websocketSec.OnOpen += Websocket_Opened;
websocketSec.OnMessage += WebsocketSec_OnMessage;
websocketSec.OnError += (o, ee) => UpdateResultDisplay($"\r\nWebSocket Error: {ee.Message}");
websocketSec.OnClose += (o, ee) => Websocket_Closed(o, null);
websocketSec.SslConfiguration.ServerCertificateValidationCallback = (s, certificate, chain, sslPolicyErrors) =>
{
websocketSec.Log.Debug($"Certificate:\n- Issuer: {certificate.Issuer}\n- Subject: {certificate.Subject}");
return true;
};
websocketSec.Connect();
工作正常。问题是服务器看到我的本地IP地址10.**.**.***
。我需要服务器来查看我的全局IP地址。
是否可以通过某种方式配置客户端以使用全局IP地址?