Skip to content

Commit f61bbac

Browse files
JAORMXclaude
andcommitted
Document why Service binds to gateway IP only
Explain in the Service struct doc that only the gateway IP is reachable from the guest, and point callers to Provider.VirtualNetwork().Listen for custom addresses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 720bbe5 commit f61bbac

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

net/hosted/service.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ import (
1515
)
1616

1717
// Service describes an HTTP service to expose inside the virtual network.
18-
// The service listens on the gateway IP (192.168.127.1) at the given port,
19-
// making it reachable from the guest VM without opening a real host socket.
18+
//
19+
// Services always bind to the gateway IP ([topology.GatewayIP], 192.168.127.1)
20+
// because that is the only host-side address reachable from the guest. Callers
21+
// that need to listen on a different address can use
22+
// [Provider.VirtualNetwork].Listen directly.
2023
type Service struct {
21-
// Port is the TCP port to listen on inside the virtual network.
24+
// Port is the TCP port to listen on at the gateway IP inside the
25+
// virtual network.
2226
Port uint16
2327

2428
// Handler is the HTTP handler that serves requests.

0 commit comments

Comments
 (0)