Skip to content

Commit f316266

Browse files
committed
fix: bind to 127.0.0.1:8080 by default, not :8080 (IPv6 fails on macOS)
On macOS, net.Listen('tcp', ':8080') creates an IPv6 socket with IPV6_V6ONLY=1, rejecting IPv4 connections. The browser resolves localhost to 127.0.0.1 (IPv4) and gets connection refused. Change default to 127.0.0.1:8080 for cross-platform compatibility. Users can still use --addr :8080 to bind all interfaces.
1 parent 263f74c commit f316266

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cmd/kode/serve.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var uiFS embed.FS
2929
// ── Serve Command ───────────────────────────────────────────────────────
3030

3131
func serveCmd(args []string) error {
32-
addr := ":8080"
32+
addr := "127.0.0.1:8080"
3333
openBrowser := false
3434

3535
for i := 0; i < len(args); i++ {
@@ -47,7 +47,7 @@ func serveCmd(args []string) error {
4747
Start the Kode web UI server.
4848
4949
Flags:
50-
--addr :8080 Listen address (default :8080)
50+
--addr 127.0.0.1:8080 Listen address (default 127.0.0.1:8080)
5151
--open Open browser automatically
5252
--help, -h Show this help`)
5353
return nil

0 commit comments

Comments
 (0)