| Server Variable | +Value | +
|---|---|
| Original URL: | +<%= Request.ServerVariables["HTTP_X_ORIGINAL_URL"] %> | +
| Final URL: | +<%= Request.ServerVariables["SCRIPT_NAME"] + "?" + Request.ServerVariables["QUERY_STRING"] %> | +
+ + +This text will be sent on the socket: + + + + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/OtherExamples/Default.htm b/test/WebRoot/WebSocket/OtherExamples/Default.htm new file mode 100644 index 0000000000..7c3b07ba22 --- /dev/null +++ b/test/WebRoot/WebSocket/OtherExamples/Default.htm @@ -0,0 +1,70 @@ +<%@ Page Language="C#" AutoEventWireUp="true" %> + + + + + +
+ + +This text will be sent on the socket: + + + + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/OtherExamples/DownloaderHandler.ashx b/test/WebRoot/WebSocket/OtherExamples/DownloaderHandler.ashx new file mode 100644 index 0000000000..b5cf323933 --- /dev/null +++ b/test/WebRoot/WebSocket/OtherExamples/DownloaderHandler.ashx @@ -0,0 +1,112 @@ +<%@ WebHandler Language="C#" Class="Handler" %> + +using System; +using System.Web; +using System.Net.WebSockets; +using System.Web.WebSockets; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using System.Net; +using System.Collections.Generic; +using System.Linq; + +public class Handler : IHttpHandler +{ + const int BUFFER = 1024*5; + bool StopFalg = false; + + public void ProcessRequest(HttpContext context) + { + if (!context.IsWebSocketRequest) + { + HttpRequest Request = context.Request; + HttpResponse Response = context.Response; + Response.Write("Simple Http"); + return; + } + + context.AcceptWebSocketRequest(async wsContext => + { + + // set up the loop + WebSocket socket = wsContext.WebSocket; + WebSocketMessageType responseType = WebSocketMessageType.Text; + int returnSize = 1024*1024; + + Thread.Sleep(500); + + Task.Run(() => + { + Recieve(socket); + }); + + Thread.Sleep(500); + + while (socket.State == WebSocketState.Open) + { + int bytesLeft = returnSize; + var tempString = string.Empty; + + while (bytesLeft > BUFFER) + { + tempString = RandomString(BUFFER); + bytesLeft -= BUFFER; + await socket.SendAsync(new ArraySegment
+This text will be sent on the socket: + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/echo.aspx b/test/WebRoot/WebSocket/echo.aspx new file mode 100644 index 0000000000..c055ee8300 --- /dev/null +++ b/test/WebRoot/WebSocket/echo.aspx @@ -0,0 +1,65 @@ +<%@ Page Language="C#" AutoEventWireUp="true" %> + + +
+This text will be sent on the socket: + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/echoAspnetCore.aspx b/test/WebRoot/WebSocket/echoAspnetCore.aspx new file mode 100644 index 0000000000..3fe9deaf28 --- /dev/null +++ b/test/WebRoot/WebSocket/echoAspnetCore.aspx @@ -0,0 +1,62 @@ +<%@ Page Language="C#" AutoEventWireUp="true" %> + + +
+This text will be sent on the socket: + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/echoSubProtocol.aspx b/test/WebRoot/WebSocket/echoSubProtocol.aspx new file mode 100644 index 0000000000..f349a3f96e --- /dev/null +++ b/test/WebRoot/WebSocket/echoSubProtocol.aspx @@ -0,0 +1,65 @@ +<%@ Page Language="C#" AutoEventWireUp="true" %> + + +
+This text will be sent on the socket: + + + + + \ No newline at end of file diff --git a/test/WebRoot/WebSocket/web.config b/test/WebRoot/WebSocket/web.config new file mode 100644 index 0000000000..5204b66b4a --- /dev/null +++ b/test/WebRoot/WebSocket/web.config @@ -0,0 +1,6 @@ + +