SaturnFramework / Saturn

Opinionated, web development framework for F# which implements the server-side, functional MVC pattern
https://saturnframework.org
MIT License
715 stars 109 forks source link

Update FSharp.Control.Websockets to 0.3.0 to fix WebSockets #389

Open 64J0 opened 1 month ago

64J0 commented 1 month ago

Description:

With this PR, I'm updating the FSharp.Control.Websockets package version to 0.3.0 so we can use WebSockets again. Btw, this issue is currently blocking me with some code.

Related issues:

How to test:

# first, assert that the problem is real
git checkout main # make sure that this branch is updated
dotnet tool restore # we need paket
cd sample/ChannelsSample
dotnet run

# use some tool to test the websocket connection
# I'm using wscat, since it's easy to use
# https://github.com/websockets/wscat
wscat -c ws://localhost:8085/channel
# notice the error right next
Connected (press CTRL+C to quit)
Disconnected (code: 1006, reason: "")

# now test this branch code
git checkout fix-ws # assert that the code is updated
dotnet run
wscat -c ws://localhost:8085/channel

# assert that it's working fine, and the connection was correctly stablished

# =======================
# another option is to open the sample web page, going to localhost:8085
# and testing it there (paying attention to the server logs)
# you can use the following endpoints through the terminal:
curl localhost:8085/ping
curl localhost:8085/ping?message=hi
64J0 commented 4 weeks ago

Seems related -> https://stackoverflow.com/questions/77943721/f-web-socket-with-saturn