You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use managed WebSockets implementation on all Windows (not UWP) #17644
area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors
Now that we have a managed implementation of Websockets that we use on Unix, should we also use it on Windows pre-Windows 8, since the current Windows implementation requires OS support only available Windows 8 and later? I'm assuming this should mostly be an issue of package authoring?
Reacted by GSPP, cperras, Fernando Alex Helwanger, Martin Björkström, Diego Bonura, Polzoni Gilberto, Sergey Galich, Mike Tselikman, Florian Hockmann, Matthew Little and 10 more
Reacted by ysmgthntt, cperras, Fernando Alex Helwanger, Polzoni Gilberto, Sergey Galich, Timothy, kronic, Ulexos, Aleksa Savić and Wesley Snell
@stephentoub I believe it's good to have an implementation of WebSockets for Win7 as long as this implementation is not replacing the WinHttp based one for Win8+.
The only downside is that the managed implementation is lacking a full implementation of the HTTP protocol required for the upgrade. To set the correct expectations: do you have a feature comparison table between the managed and WinHttp-based implementations?
I believe it's good to have an implementation of WebSockets for Win7 as long as this implementation is not replacing the WinHttp based one for Win8+
@ericstj, we can specialize the package in this way, right? i.e. have a build for Win7 and a different one for Win8+?
To set the correct expectations: do you have a feature comparison table between the managed and WinHttp-based implementations?
I don't, but if you list out the features, I can share which the managed does/doesn't currently support. Some of the limitations are things it looks like the WinHTTP implementation isn't respecting anyway, e.g. we don't currently pay attention to the ClientWebSocketOptions.Proxy in the managed implementation (should be relatively straightforward to add, though), but then looking at the WinHTTP implementation, it appears to ignore it as well.
some of the limitations are things it looks like the WinHTTP implementation isn't respecting anyway, e.g. we don't currently pay attention to the ClientWebSocketOptions.Proxy
This is correct and the expectation is set via the following issues: #15994, #14911.
If I correctly recall, the contract is also missing a few tests and requires further unification with WinHttpHandler. /cc: @davidsh
Since we already have some of the testing done and most code shouldn't change, working on this item should be fairly easy (but adding extra tests is always welcomed). Requires Win7/ build -outerloop testing.
Bump, is there any progress on this? We've stumbled upon this exact issue in dotnet/corefx#24249 as well as SteamRE/SteamKit#455. It'd probably be a good idea to address this.
If people are in a crunch there are a bazillion pure managed implementations out there. My issue is that the kestrel websocket add-on fails due to this bug, so I now have to write my own plugin for kestrel.
changed the title [-]Use managed WebSockets implementation on Windows 7?[/-][+]Use managed WebSockets implementation on all Windows (not UWP)[/+]on Dec 8, 2017
In internal discussion we found out that shipping the package just for Win7 is difficult and problematic. We are going with option [3] above -- use managed WebSockets for all Windows (except UWP). Title updated.
More details on the risk assessment from @davidsh (thanks!)
Both implementations (managed and WinHttp based) have the same feature gaps.
The managed WebSocket implementation (currently used only on Linux) is missing HTTP auth and proxy support.
The Windows .NET Core WebSockets implementation used on Windows 8+ (using WinHTTP) is also not using HTTP auth nor proxy settings.
While it is easier to enable HTTP auth and proxy for the WinHTTP based implementation, it doesn’t help the managed implementation which is used on Linux. In addition, there is a desire to enable Windows 7 .NET Core support for WebSockets which would require the managed implementation as well.
In terms of test support, it is equivalent. The assumption, though, is that any PRs enhancing the managed WebSockets implementation to add HTTP auth and proxy support would include tests.
I have no problem getting rid of the WinHTTP based implementation for Windows WebSocket on .NET Core and converging on the managed implementation.
For now, though, this work will not include the .NET Core UWP implementation of WebSockets which uses yet another different implementation (WinRT WebSockets).
Reacted by Jesse Nicholson, Cristian Pop, Tamer Awad, David Fowler, Diego Bonura and Wesley Snell
@qmfrederik How did you manage to make this work on Windows? Maybe I'm thick lately but following the bread crumbs of your comments has not led me to a solution.
@TechnikEmpire What I did was to clone the CoreFX repository, edit src\System.Net.WebSockets.Client\src\System.Net.WebSockets.Client.csproj so that the package always targets Linux (which means using the managed handler):
and then building that project. You'll probably want to build corefx from the root first if you haven't done so already.
It should get you a System.Net.WebSockets.Client.dll library you can use. I copied that dll to the NuGet cache folder so my projects would always use the modified version.
area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionshelp wanted[up-for-grabs] Good issue for external contributors
Activity
stephentoub commentedon Jun 17, 2016
See some numbers in my PR here:
dotnet/corefx#9412
meriturva commentedon Sep 28, 2016
Any news here? is it planed to be released on milestone 1.2.0 ? April 2017 ? I think that we need a solution now for Windows 7! What do you think?
CIPop commentedon Sep 29, 2016
@stephentoub I believe it's good to have an implementation of WebSockets for Win7 as long as this implementation is not replacing the WinHttp based one for Win8+.
The only downside is that the managed implementation is lacking a full implementation of the HTTP protocol required for the upgrade. To set the correct expectations: do you have a feature comparison table between the managed and WinHttp-based implementations?
stephentoub commentedon Sep 29, 2016
@ericstj, we can specialize the package in this way, right? i.e. have a build for Win7 and a different one for Win8+?
I don't, but if you list out the features, I can share which the managed does/doesn't currently support. Some of the limitations are things it looks like the WinHTTP implementation isn't respecting anyway, e.g. we don't currently pay attention to the ClientWebSocketOptions.Proxy in the managed implementation (should be relatively straightforward to add, though), but then looking at the WinHTTP implementation, it appears to ignore it as well.
CIPop commentedon Sep 29, 2016
Answering this is definitely not an easy task given the large RFCs for both HTTP/S and WebSockets. Here are a few of WinHTTPs features as well as a link to the WS RFC: https://msdn.microsoft.com/en-us/library/windows/desktop/aa382925(v=vs.85).aspx
This is correct and the expectation is set via the following issues: #15994, #14911.
If I correctly recall, the contract is also missing a few tests and requires further unification with WinHttpHandler. /cc: @davidsh
CIPop commentedon Dec 8, 2016
I've added my idea of an implementation plan in https://github.com/dotnet/corefx/issues/13663#issuecomment-265879275. The plan can be split to handle this item (leave the code in S.N.WebSocket.Client but add an OS platform check).
Since we already have some of the testing done and most code shouldn't change, working on this item should be fairly easy (but adding extra tests is always welcomed). Requires Win7/
build -outerlooptesting.JustArchi commentedon Sep 26, 2017
Bump, is there any progress on this? We've stumbled upon this exact issue in dotnet/corefx#24249 as well as SteamRE/SteamKit#455. It'd probably be a good idea to address this.
MikhailArkhipov commentedon Oct 5, 2017
We really need this to support R in VS Code. Many R users are on Win7
wsnell commentedon Nov 21, 2017
Desperately need
TechnikEmpire commentedon Nov 24, 2017
If people are in a crunch there are a bazillion pure managed implementations out there. My issue is that the kestrel websocket add-on fails due to this bug, so I now have to write my own plugin for kestrel.
stephentoub commentedon Nov 24, 2017
The implementation that's used here on Unix is managed, built on sockets.
19 remaining items
wsnell commentedon Dec 1, 2017
[-]Use managed WebSockets implementation on Windows 7?[/-][+]Use managed WebSockets implementation on all Windows (not UWP)[/+]karelz commentedon Dec 8, 2017
In internal discussion we found out that shipping the package just for Win7 is difficult and problematic. We are going with option [3] above -- use managed WebSockets for all Windows (except UWP). Title updated.
More details on the risk assessment from @davidsh (thanks!)
davidfowl commentedon Dec 13, 2017
😍 this is great news
TechnikEmpire commentedon Dec 22, 2017
@kasper3 lol feel free to submit a PR.
qmfrederik commentedon Dec 22, 2017
@kasper3 if you open the drtails for that package, you should see preview1 builds which are much more recent. You'll want those.
qmfrederik commentedon Dec 22, 2017
See this comment on how to get the latest build: https://github.com/dotnet/corefx/issues/5120#issuecomment-348617702
TechnikEmpire commentedon Jan 18, 2018
@qmfrederik How did you manage to make this work on Windows? Maybe I'm thick lately but following the bread crumbs of your comments has not led me to a solution.
qmfrederik commentedon Jan 18, 2018
@TechnikEmpire What I did was to clone the CoreFX repository, edit
src\System.Net.WebSockets.Client\src\System.Net.WebSockets.Client.csprojso that the package always targets Linux (which means using the managed handler):and then building that project. You'll probably want to build corefx from the root first if you haven't done so already.
It should get you a System.Net.WebSockets.Client.dll library you can use. I copied that dll to the NuGet cache folder so my projects would always use the modified version.