public SetCredentials ( string username, string password, bool preAuth ) : void | ||
username | string |
/// |
password | string |
/// A |
preAuth | bool |
/// |
return | void |
public override object ConstructObject() { string[] protocols; if (FProtocols[this.CurrObj][0] != "") { protocols = new string[FProtocols[this.CurrObj].SliceCount]; for (int i = 0; i < FProtocols[this.CurrObj].SliceCount; i++) { protocols[i] = FProtocols[this.CurrObj][i]; } } else { protocols = new string[0]; } WebSocketSharp.WebSocket newWebSocket = new WebSocketSharp.WebSocket(FUrl[this.CurrObj], protocols); VebSocketHostedClient newVebSocketClient = new VebSocketHostedClient(newWebSocket); newVebSocketClient.SubscribeToMainloop(this.FHDEHost); if (FOrigin[this.CurrObj] != "") { newWebSocket.Origin = FOrigin[this.CurrObj]; } if (FCookie.IsConnected && (FCookie[this.CurrObj] != null)) { newWebSocket.SetCookie(FCookie[this.CurrObj]); } if (FServerCertValidCallback.IsConnected && (FServerCertValidCallback[this.CurrObj] != null)) { newWebSocket.SslConfiguration.ServerCertificateValidationCallback = FServerCertValidCallback[this.CurrObj]; } if ((FUser[this.CurrObj] != "") || (FPassword[this.CurrObj] != "")) { newWebSocket.SetCredentials(FUser[this.CurrObj], FPassword[this.CurrObj], FPreAuth[this.CurrObj]); } if (FAutoConnect[this.CurrObj]) { newWebSocket.ConnectAsync(); } return(newVebSocketClient); }