Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created May 27, 2020 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/83a5d406e7b7f5edf3266deafe1dd2c3 to your computer and use it in GitHub Desktop.
Save bjoerntx/83a5d406e7b7f5edf3266deafe1dd2c3 to your computer and use it in GitHub Desktop.
@using TXTextControl.Web.MVC
@{
// use an access token (for example returned by OAuth)
var sAccessToken = "821e2f35-86e3-4917-a963-b0c4228d1315";
// build WebSocketURL including access token in query string
var sProtocol = (Request.Url.Scheme == "https") ? "wss://" : "ws://";
var sWebSocketURL = sProtocol + Request.Url.Authority +
"/api/TXWebSocket?access_token=" + sAccessToken;
}
@Html.TXTextControl().TextControl(settings => {
settings.WebSocketURL = sWebSocketURL; // pass built WebSocketURL
}).Render()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment