-
Notifications
You must be signed in to change notification settings - Fork 266
atunnel: ingress CONNECT support #993
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
Changes from all commits
2151d1e
b34e0cc
73b8bd7
c3fd5b5
165454a
e6bc515
4ce7ac1
50535a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,7 @@ func main() { | |
| secondFileCounterDirectory := pflag.String("second-file-counter-directory", "", "Directory for a second file counter; empty disables it. Used to exercise an Actor with more than one durable volume") | ||
| validateExistingFilePath := pflag.String("validate-existing-file-path", "", "Path to existing file to validate reading") | ||
| extraPort := pflag.Int("extra-port", 0, "Additional port to listen on, for exercising atenet-router's arbitrary-port ingress support; 0 disables it") | ||
| tcpPort := pflag.Int("tcp-port", 0, "Plain TCP echo port for exercising atunnel CONNECT ingress; 0 disables it") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure I follow what is it for?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh sorry I was testing a branch for adding TCP support and this snuck into the final version. I can remove if we'd like, but it's probably nice to keep around |
||
| pflag.Parse() | ||
| ctx := context.Background() | ||
|
|
||
|
|
@@ -177,6 +178,28 @@ func main() { | |
| }() | ||
| } | ||
|
|
||
| if *tcpPort > 0 { | ||
| go func() { | ||
| listener, err := net.Listen("tcp", fmt.Sprintf(":%d", *tcpPort)) | ||
| if err != nil { | ||
| slog.ErrorContext(ctx, "Error starting counter TCP echo server", slog.Any("err", err)) | ||
| os.Exit(1) | ||
| } | ||
| slog.InfoContext(ctx, "Starting counter TCP echo server", slog.Int("port", *tcpPort)) | ||
| for { | ||
| conn, err := listener.Accept() | ||
| if err != nil { | ||
| slog.ErrorContext(ctx, "Counter TCP echo accept failed", slog.Any("err", err)) | ||
| return | ||
| } | ||
| go func() { | ||
| defer conn.Close() | ||
| _, _ = io.Copy(conn, conn) | ||
| }() | ||
| } | ||
| }() | ||
| } | ||
|
|
||
| // Write some random data to a file in the root filesystem, to test | ||
| // filesystem checkpoint/restore. | ||
| if err := writeRandomFile(); err != nil { | ||
|
|
||
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 was added to try to reduce some flakiness with OnUpdate being written to/read across tests