Last active
November 2, 2021 21:10
-
-
Save bjoerntx/3e0679b0dcad9129156e89304aa0fc73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using TXTextControl.Web.MVC | |
@{ | |
Random rand = new Random(); | |
string serverId = rand.Next(0, 2).ToString(); | |
// build WebSocketURL including a server id in query string | |
var sProtocol = (Context.Request.IsHttps) ? "wss://" : "ws://"; | |
var sWebSocketURL = sProtocol + Context.Request.Host | |
+ "/TXWebSocket?server=" + serverId; | |
} | |
@Html.TXTextControl().TextControl(settings => { | |
settings.WebSocketURL = sWebSocketURL; | |
}).Render() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment