public SetProxy ( string url, string username, string password ) : void | ||
url | string |
/// |
username | string |
/// |
password | string |
/// A |
리턴 | void |
public WebSocketClient(IMessageInterpreter interpreter, string url, ProxySettings proxySettings) { _interpreter = interpreter; _webSocket = new WebSocket(url); _webSocket.OnMessage += WebSocketOnMessage; _webSocket.OnClose += (sender, args) => OnClose?.Invoke(sender, args); _webSocket.Log.Level = GetLoggingLevel(); _webSocket.EmitOnPing = true; if (proxySettings != null) { _webSocket.SetProxy(proxySettings.Url, proxySettings.Username, proxySettings.Password); } }
private void CreateWebSocketClient() { if (ws != null && ws.IsAlive) return; ws = new WebSocket(location.Text); connect.Enabled = false; setHeaders.Enabled = false; proxyButton.Enabled = false; location.ReadOnly = true; ws.SetHeaders(headers); ws.SetProxy(proxyUrl, string.Empty, string.Empty); ws.OnError += Ws_OnError; ws.OnClose += Ws_OnClose; ws.OnMessage += Ws_OnMessage; ws.OnOpen += Ws_OnOpen; ws.Connect(); }
private void InitializeInBackground(string url, WebSocketSharp.WebSocket webSocket, JObject options) { var parsedOptions = new WebSocketOptions(options); ProxyHelper proxy = null; if (parsedOptions.UseDefaultProxy) { proxy = new ProxyHelper(new Uri(url)); } else { proxy = new ProxyHelper(parsedOptions); } if (proxy != null && !proxy.IsBypassed) { webSocket.SetProxy(proxy.ProxyAddress, proxy.UserName, proxy.Password); } webSocket.Origin = parsedOptions.Origin; webSocket.Connect(); }