-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat(traefik) allow websocket traffic #275
base: main
Are you sure you want to change the base?
Conversation
22da4f7
to
34da04b
Compare
34da04b
to
db33c53
Compare
db33c53
to
0ca9f64
Compare
This is by design you need to follow redirection. Explained in https://github.com/acouvreur/sablier/pull/241 |
if isWebsocketRequest(req) { | ||
// FIXME dynamic make no sense for websocket since client return error | ||
fmt.Println("=== websocket request") | ||
go monitorWebSocketActivity(sablierRequest, sm) |
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.
I was thinking about this approach also. You create go routine per connection. I wondered if this would scale up. I didn't check details though.
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.
it should scale correctly , maybe in next iteration , we should add Mutex for security , but not really conformtable with it
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.
I wrote a proxy for Sablier to handle TCP only services and had a similar problem: How to prevent the service from shutting down, if there are only long running connections.
I don't check if there is actual activity on the connection, but I have a single task/process that will, as long as there is at least 1 active connection, ping the Sablier endpoint in regular intervals. Maybe something like this would work here, too:
https://github.com/vbrandl/sablier-proxy/blob/main/src/main.rs#L154
This way, you don't have to spawn another goroutine per connection, but there will be exactly 1 monitoring task/routine, which might scale better if there are many connections.
will check that! thank you EDIT: tbh , i don't fully understand what happnd , can you please have a look |
|
@acouvreur could you please enable github action on this PR. I would like to see the test results. |
It looks that you have to handle retry on client side https://github.com/trazfr/tcp-over-websocket/blob/fcb1b85e9fd0e282eee88815efeca8d729bd762b/httpClient.go#L86C14-L86C36 |
Will have a look a it asap Thank you :) |
any progress on that? |
Did not have time sorry to debug this EDIT: been a while, since i touched Sablier's code, @tomaszduda23 can you please elaborate a bit what you means , by retry on client side ? |
Quality Gate passedIssues Measures |
It seems that go client won't handle redirect by itself. You can reference this |
i tried some stuff, but everytime i brooke something else, dunno if i'll be able to finish that quickly |
as @tomaszduda23 mentionned, i reoppend a PR
to make some reviews
atm
302 error on first try
) ❌but tested manually
with docker
i can reach
ws://localhost:8080/echo
container is ready , i can talk with the
whoami WS
even, it's not shtudown , once i stop , aftersession-duration
hte container i stoppededit:
can i split a bit the code like
types.go
wsHandler.go
main.go
to have a better reading ? or i let you do this on the v2 @acouvreur
Closed: #21 #42 #152