Skip to content

Commit 1e0695f

Browse files
scouzi1966claude
andcommitted
Restrict server to localhost-only connections for enhanced security
Changes server binding from 0.0.0.0 to 127.0.0.1 to prevent external network access. This security improvement ensures the API server only accepts connections from the local machine, eliminating potential remote access risks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d5b1849 commit 1e0695f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/MacLocalAPI/Server.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Server {
3636

3737
private func configure() throws {
3838
app.http.server.configuration.port = port
39-
app.http.server.configuration.hostname = "0.0.0.0"
39+
app.http.server.configuration.hostname = "127.0.0.1"
4040

4141
try routes()
4242
}
@@ -84,7 +84,7 @@ class Server {
8484
print("Press Ctrl+C to stop the server")
8585

8686
// Start the server
87-
try await app.server.start(address: .hostname("0.0.0.0", port: port))
87+
try await app.server.start(address: .hostname("127.0.0.1", port: port))
8888

8989
// Wait indefinitely (until shutdown is called)
9090
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in

0 commit comments

Comments
 (0)