Skip to content

Commit ffc2cb3

Browse files
authored
Merge pull request #4 from scouzi1966/security/localhost-only-binding
Security: Restrict server to localhost-only connections
2 parents d5b1849 + 1e0695f commit ffc2cb3

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)