Created
May 27, 2020 14:50
-
-
Save bjoerntx/c2cdfa1004b8bafb7f5353c4d7226b70 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
[WebSocketAuth] | |
public class TXWebSocketController : ApiController { | |
public HttpResponseMessage Get() { | |
if (HttpContext.Current.IsWebSocketRequest) { | |
var wsHandler = new WebSocketHandler(); | |
wsHandler.ProcessRequest(HttpContext.Current); | |
return new HttpResponseMessage(HttpStatusCode.SwitchingProtocols); | |
} | |
return new HttpResponseMessage(HttpStatusCode.OK); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment