Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement System.Net.WebSockets.Client on Unix #14897

Closed
stephentoub opened this issue Jul 24, 2015 · 16 comments · Fixed by dotnet/corefx#9258
Closed

Implement System.Net.WebSockets.Client on Unix #14897

stephentoub opened this issue Jul 24, 2015 · 16 comments · Fixed by dotnet/corefx#9258
Assignees
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions os-linux Linux OS (any supported distro)
Milestone

Comments

@stephentoub
Copy link
Member

No description provided.

@SidharthNabar
Copy link

Pre-requisite to this issue is: dotnet/corefx#2490

@joshfree joshfree assigned pgavlin and vijaykota and unassigned pgavlin Oct 12, 2015
@vijaykota vijaykota assigned joshfree and unassigned vijaykota Nov 19, 2015
@Flavien
Copy link

Flavien commented Nov 26, 2015

Is this planned for RC2?

WebSockets client is not supported on Linux (System.PlatformNotSupportedException: The WebSocket protocol is not supported on this platform.), this is quite an important feature, it would be great if it makes it for RC2.

@joshfree
Copy link
Member

joshfree commented Dec 1, 2015

Hi @Flavien I agree this is an important feature; it's currently not slated for RC2 at this time. I suspect right now that the feature will come off the backlog early next year for the next minor update after 1.0. With that said, we'd be receptive to community contributions in this space earlier than that.

CC'ing some folks who can discuss the open design issues.

/cc @stephentoub @SidharthNabar @vijaykota

@vijaykota vijaykota assigned vijaykota and unassigned joshfree Dec 9, 2015
roncain referenced this issue in roncain/wcf Dec 11, 2015
Adds [ActiveIssue(625, PlatformID.AnyUnix)] to WebSockets tests
because they cannot pass until support has been added.

Support of WebSockets on Linux in CoreFx is tracked by issue
https://github.com/dotnet/corefx/issues/2486
@ayende
Copy link
Contributor

ayende commented Feb 18, 2016

Any news on this feature?

@joshfree
Copy link
Member

@ayende this is still on the backlog

@ayende
Copy link
Contributor

ayende commented Feb 19, 2016

Can you explain a bit what is required to make this happen? We need this functionality, and want to know if we can contribute it.

Since Kesterl is how this is served on Linux, and since it is already working on Windows, I assume that there isn't something big that is missing right now.

@davidfowl
Copy link
Member

@ayende We have a websocket client here https://github.com/aspnet/WebSockets/ but we haven't looked into the what a websocket upgrade looks like using libcurl (maybe it just works?). Here's what we have today (it's only tests on .NET Framework):

Wire up the websocket prefixes:

https://github.com/aspnet/WebSockets/blob/dev/src/Microsoft.AspNetCore.WebSockets.Client/WebSocketClient.cs#L23

Create the websocket from the opaque stream:

https://github.com/aspnet/WebSockets/blob/dev/src/Microsoft.AspNetCore.WebSockets.Client/WebSocketClient.cs#L74

You could possibly make this work if the HttpClient implementation gives you back the raw stream. You could hand it over to the websocket protocol layer.

/cc @Tratcher

@ayende
Copy link
Contributor

ayende commented Feb 19, 2016

Okay, so the current limitation is client side, right? Is there any issues
on the server side on Linux?

*Hibernating Rhinos Ltd *

Oren Eini* l CEO l *Mobile: + 972-52-548-6969

Office: +972-4-622-7811 *l *Fax: +972-153-4-622-7811

On Fri, Feb 19, 2016 at 8:47 PM, David Fowler notifications@github.com
wrote:

@ayende https://github.com/ayende We have a websocket client here
https://github.com/aspnet/WebSockets/ but we haven't looked into the what
a websocket upgrade looks like using libcurl (maybe it just works?). Here's
what we have today (it's only tests on .NET Framework):

Wire up the websocket prefixes:

https://github.com/aspnet/WebSockets/blob/dev/src/Microsoft.AspNetCore.WebSockets.Client/WebSocketClient.cs#L23

Create the websocket from the opaque stream:

https://github.com/aspnet/WebSockets/blob/dev/src/Microsoft.AspNetCore.WebSockets.Client/WebSocketClient.cs#L74

You could possibly make this work if the HttpClient implementation gives
you back the raw stream. You could hand it over to the websocket protocol
layer.

/cc @Tratcher https://github.com/Tratcher


Reply to this email directly or view it on GitHub
https://github.com/dotnet/corefx/issues/2486#issuecomment-186356965.

@davidfowl
Copy link
Member

WebSockets isn't being shipped as 1.0 as part of the ASP.NET Core 1.0 release. Though others are using it and it seems to be working just fine 😄 . Do try it out and if you find any issues, contribute to the repo. https://github.com/aspnet/WebSockets/

/cc @benaadams

@benaadams
Copy link
Member

@ayende we've used the WebSockets middleware to send over 40 billion messages at an extremely high frequency; there are some issues; but if you are already handling reconnects - the biggest of which is probably a noisy log file aspnet/WebSockets#63

@ayende
Copy link
Contributor

ayende commented Feb 19, 2016

Yes, we are using this as well, and I wanted to verify that the current
limitation on Linux was just plugging libcurl properly

*Hibernating Rhinos Ltd *

Oren Eini* l CEO l *Mobile: + 972-52-548-6969

Office: +972-4-622-7811 *l *Fax: +972-153-4-622-7811

On Fri, Feb 19, 2016 at 9:30 PM, Ben Adams notifications@github.com wrote:

@ayende https://github.com/ayende we've used the WebSockets middleware
to send over 40 billion messages at an extremely high frequency; there are
some issues; but if you are already handling reconnects - the biggest of
which is probably a noisy log file aspnet/WebSockets#63
aspnet/WebSockets#63


Reply to this email directly or view it on GitHub
https://github.com/dotnet/corefx/issues/2486#issuecomment-186369611.

@Tratcher
Copy link
Member

@davidfowl We've never even prototyped a way to do an opaque upgrade via HttpClient. I have a few ideas, but you can't just use the Stream from StreamContent because it gives you a restricted wrapper.

@ayende
Copy link
Contributor

ayende commented Feb 19, 2016

From my perspective, if there is a problem with libcurl, we can just fall
back to a completely managed impl.
Such as starting from here:
https://github.com/sta/websocket-sharp/tree/master/websocket-sharp

The stumbling block is the server, so I'm pretty happy, even if libcurl
proves problematic.

*Hibernating Rhinos Ltd *

Oren Eini* l CEO l *Mobile: + 972-52-548-6969

Office: +972-4-622-7811 *l *Fax: +972-153-4-622-7811

On Fri, Feb 19, 2016 at 9:36 PM, Chris R notifications@github.com wrote:

@davidfowl https://github.com/davidfowl We've never even prototyped a
way to do an opaque upgrade via HttpClient. I have a few ideas, but you
can't just use the Stream from StreamContent because it gives you a
restricted wrapper.


Reply to this email directly or view it on GitHub
https://github.com/dotnet/corefx/issues/2486#issuecomment-186371040.

@ayende
Copy link
Contributor

ayende commented Feb 21, 2016

I tried getting started on this, but it seems like the CLI is currently badly broken (see: https://github.com/aspnet/cli-samples/issues/15).
Couldn't get even the samples to work

@qooroo
Copy link

qooroo commented May 31, 2016

Are there any updates on this? We've been porting projects from mono to .net core and this is the only blocker remaining. I'd be happy to contribute to any work in progress items.

@ayende
Copy link
Contributor

ayende commented Jun 1, 2016

@qooroo We have implemented a trivial fix for this by writing this:
https://github.com/ayende/ravendb/blob/v4.0/src/Raven.Client/Platform/Unix/RavenUnixClientWebSocket.cs

It is not to be considered a viable alternative to a real implementation, but it allowed us to get ahead and not be blocked by this missing feature.

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 1.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net enhancement Product code improvement that does NOT require public API changes/additions os-linux Linux OS (any supported distro)
Projects
None yet
Development

Successfully merging a pull request may close this issue.