From 667095661bbc0acb120c8bdeafbbe2bd87239cd0 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Thu, 23 Feb 2017 10:56:20 -0800 Subject: [PATCH] convert the samples to use the official client (#234) --- samples/SocketsSample/wwwroot/hubs.html | 13 +-- samples/SocketsSample/wwwroot/index.html | 14 ++- samples/SocketsSample/wwwroot/polling.html | 109 ------------------ samples/SocketsSample/wwwroot/sockets.html | 47 ++++++++ samples/SocketsSample/wwwroot/sse.html | 109 ------------------ samples/SocketsSample/wwwroot/utils.js | 12 ++ samples/SocketsSample/wwwroot/ws.html | 3 +- ...xtensions.WebSockets.Internal.Tests.csproj | 1 + .../SkipIfEnvVarPresentAttribute.cs | 22 ++++ .../WebSocketConnectionTests.PingPong.cs | 4 +- 10 files changed, 95 insertions(+), 239 deletions(-) delete mode 100644 samples/SocketsSample/wwwroot/polling.html create mode 100644 samples/SocketsSample/wwwroot/sockets.html delete mode 100644 samples/SocketsSample/wwwroot/sse.html create mode 100644 samples/SocketsSample/wwwroot/utils.js create mode 100644 test/Microsoft.Extensions.WebSockets.Internal.Tests/SkipIfEnvVarPresentAttribute.cs diff --git a/samples/SocketsSample/wwwroot/hubs.html b/samples/SocketsSample/wwwroot/hubs.html index 50eb252d78..5594873ea7 100644 --- a/samples/SocketsSample/wwwroot/hubs.html +++ b/samples/SocketsSample/wwwroot/hubs.html @@ -52,20 +52,9 @@ + - - -

Long Polling

- -
- - -
- - - - diff --git a/samples/SocketsSample/wwwroot/sockets.html b/samples/SocketsSample/wwwroot/sockets.html new file mode 100644 index 0000000000..f6af38c423 --- /dev/null +++ b/samples/SocketsSample/wwwroot/sockets.html @@ -0,0 +1,47 @@ + + + + + + + +

Unknown Transport

+ +
+ + +
+ + + + + + + diff --git a/samples/SocketsSample/wwwroot/sse.html b/samples/SocketsSample/wwwroot/sse.html deleted file mode 100644 index 4a43947c95..0000000000 --- a/samples/SocketsSample/wwwroot/sse.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - -

Server Sent Events

- -
- - -
- - - - diff --git a/samples/SocketsSample/wwwroot/utils.js b/samples/SocketsSample/wwwroot/utils.js new file mode 100644 index 0000000000..ef155b5a2d --- /dev/null +++ b/samples/SocketsSample/wwwroot/utils.js @@ -0,0 +1,12 @@ +function getParameterByName(name, url) { + if (!url) { + url = window.location.href; + } + name = name.replace(/[\[\]]/g, "\\$&"); + var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), + results = regex.exec(url); + if (!results) return null; + if (!results[2]) return ''; + return decodeURIComponent(results[2].replace(/\+/g, " ")); +} + diff --git a/samples/SocketsSample/wwwroot/ws.html b/samples/SocketsSample/wwwroot/ws.html index 0a534b6469..8990fa27d3 100644 --- a/samples/SocketsSample/wwwroot/ws.html +++ b/samples/SocketsSample/wwwroot/ws.html @@ -5,8 +5,7 @@