-
Notifications
You must be signed in to change notification settings - Fork 265
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
WIP: Add WebSockets lib #182
Conversation
Might we worth adding some tests too using use server = new TestServer(WebHostBuilder().Configure(fun app -> configure app))
let wsClient = server.CreateWebSocketClient()
let! websocket = wsClient.ConnectAsync(server.BaseAddress, CancellationToken.None) |
There also might be some value comparing and contrasting this implementation with https://gist.github.com/TheAngryByrd/22b5df5a308f9f96f959980d0a42f7cd For instance we probably should rely on WebSocketReceiveResult.EndOfMessage |
@TheAngryByrd please send PRs to my fork |
@TheAngryByrd I made receive into a loop. I would appreciate some tests |
@TheAngryByrd thanks for working with me together on this. I'm sure we can create something cool out of it. |
@@ -12,12 +12,17 @@ | |||
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.0.*" /> | |||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.*" /> | |||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.*" /> | |||
|
|||
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.0.*" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so dangerous. It should be pinned or converted to paket. Floating versions are such an anti pattern. Especially together with transitive deps.
7249b1d
to
c29c294
Compare
@TheAngryByrd I'm now using TokenRouter to configure the server. And we have a broadcast test |
@forki check https://github.com/fsharp/FsAutoComplete/blob/c5cde65a47879f92bf262bb1ea414df5edd809d4/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx#L194 you need to test also EndOfMessage property |
Another good idea ihmo (found checking ws with suave in FSAC) will be implement the autobahn test suite to test the server http://websockets.github.io/ws/autobahn/servers/ to test the implementation ( link is the node ws test report ). |
@TheAngryByrd @gerardtoconnor for some reason the tests with n=100 / 1000 are going into timeout. Any ideas why it is soooo slow? |
ok I found the issue |
Hi, I don't like letting people wait, so I've written an update on the Swagger PR and I was thinking of proposing the same here if that sounds good to you @forki ? |
I'm fine with waiting for now. |
Ok cool, just wanted to let everyone know that things are progressing every day and I'll eventually get to the bigger PRs as well. If something is urgent then there is that option of an early Alpha release. |
Guys, |
I had created a similar implementation based on the asp docs and this blog post. I like the PR here a bit more. One thing I noticed in the current PR state is that there is no opportunity to add behavior when a socket is closed. This is useful for updating UI when a user has left the web app. If there was perhaps an overload of |
@Banashek can you please send a pull request to my fork with your proposal? Let's work together on this to make it great |
Adding some error handling around receiving of messages
Update WebSockets.fs
I plan to create a version of Elmish.Remoting for Giraffe. Should I wait a little more for this PR to get merged? |
No updates from Dustin for quite a while unfortunately. I would love to see the remoting working over WebSockets for Giraffe! |
This is still WIP since I'm still trying to figure out an idiomatic way |
Based on what you did until now, do you think it would be too much effort to replicate what Suave did? |
I personally use 3 months old version (without latest commits) and it does the job pretty well for me, but I'm missing onClose event. The latest one has onClose but doesn't pass the ref into onOpen (as far as I remember) |
The problem with the older version is that it can crash the whole giraffe
app for some strange edge cases. The current version does not seem to have
that issue. I still need to add a queue for sending, but that will be done
when I'm back from vacation.
Yuriy Habarov <notifications@github.com> schrieb am Fr., 1. Juni 2018,
00:05:
… I personally use 3 months old version (without latest commits) and it does
the job pretty well for me, but I'm missing onClose event. The latest one
has onClose but doesn't pass the ref into onOpen (as far as I remember)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNEz4_eMetXtdgIsgA1HNx2tgqDHGks5t4GkegaJpZM4RFmH9>
.
|
Thank you @forki , much appreciated! Hope @dustinmoris will kindly merge it into the master and release soon together with the Swagger PR. |
I this PR dead? Haven't got any activity for three month, is there any way I can help here to get websocket support in Giraffe? |
I wasn't actively working on this one myself, but I'm happy to put this
into a Giraffe.Sockets package when this work is done? Last thing I
remember it was still WIP?
…On Sat, 29 Sep 2018, 11:21 Kolja Dummann, ***@***.***> wrote:
I this PR dead? Haven't got any activity for three month, is there any way
I can help here to get websocket support in Giraffe?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEXlak5ip1ojBvM2sYWMWm3Sj0Iivdp8ks5uf0mlgaJpZM4RFmH9>
.
|
My current WIP version is working fine in production for quite a while now.
Maybe we should just release it to a new package and see what users feel
about it
Dustin Moris Gorski <notifications@github.com> schrieb am Sa., 29. Sep.
2018, 13:30:
… I wasn't actively working on this one myself, but I'm happy to put this
into a Giraffe.Sockets package when this work is done? Last thing I
remember it was still WIP?
On Sat, 29 Sep 2018, 11:21 Kolja Dummann, ***@***.***>
wrote:
> I this PR dead? Haven't got any activity for three month, is there any
way
> I can help here to get websocket support in Giraffe?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#182 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AEXlak5ip1ojBvM2sYWMWm3Sj0Iivdp8ks5uf0mlgaJpZM4RFmH9
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNCeehspHJXxPAoHfrROFMNxgisS6ks5uf1nYgaJpZM4RFmH9>
.
|
Sounds good to me! Do you think you can maybe also provide a bit of
documentation around it? Something that can go into the README of the
package repo? It doesn't have to be big, maybe look at TokenRouter as an
example or the Razor view engine package.
On Sat, 29 Sep 2018, 14:01 Steffen Forkmann, <notifications@github.com>
wrote:
… My current WIP version is working fine in production for quite a while now.
Maybe we should just release it to a new package and see what users feel
about it
Dustin Moris Gorski ***@***.***> schrieb am Sa., 29. Sep.
2018, 13:30:
> I wasn't actively working on this one myself, but I'm happy to put this
> into a Giraffe.Sockets package when this work is done? Last thing I
> remember it was still WIP?
>
> On Sat, 29 Sep 2018, 11:21 Kolja Dummann, ***@***.***>
> wrote:
>
> > I this PR dead? Haven't got any activity for three month, is there any
> way
> > I can help here to get websocket support in Giraffe?
> >
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub
> > <
>
#182 (comment)
> >,
> > or mute the thread
> > <
>
https://github.com/notifications/unsubscribe-auth/AEXlak5ip1ojBvM2sYWMWm3Sj0Iivdp8ks5uf0mlgaJpZM4RFmH9
> >
> > .
> >
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#182 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AADgNCeehspHJXxPAoHfrROFMNxgisS6ks5uf1nYgaJpZM4RFmH9
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEXlapEF2KTVu1KLk8NH3_ZremrbUKDzks5uf28OgaJpZM4RFmH9>
.
|
Sorry this completely wrong approach. I will come up with a new one |
Not sure where it belongs.