mirror of
https://github.com/mmatczuk/go-http-tunnel.git
synced 2026-05-15 14:16:17 -06:00
[GH-ISSUE #20] How do i start my server but subscribe later? #8
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/go-http-tunnel#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ptheunis on GitHub (May 10, 2017).
Original GitHub issue: https://github.com/mmatczuk/go-http-tunnel/issues/20
Basically, i want to run 1 proxy and n clients.
But I am unaware of the clients at start-up.
Can I start the server in a goroutine and call subscribe on that server at a later time?
@mmatczuk commented on GitHub (May 10, 2017):
Hi Paul,
the server supports this even with unsubscribing connected clients etc. yet the CLI does not. You can use the tunnel as a library and register clients yourself see https://github.com/mmatczuk/go-http-tunnel/blob/master/cmd/tunneld/tunneld.go for reference how this can be done.
I'll add another issue to add control over that while running. Maybe a REST API on a dedicated port WDYT would be the most convenient to use for you?
@ptheunis commented on GitHub (May 10, 2017):
Right now i've solved it by adding a for {} to my main loop and running Server.Start() in a go func.
Either way a rest-api to add new clients would be great 👍
@mmatczuk commented on GitHub (May 11, 2017):
@pault84 I moved the REST API to https://github.com/mmatczuk/go-http-tunnel/issues/21. If you value the tunnel please consider starring it to help the adoption, thanks!