mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-09 11:55:53 +00:00
Simplify server port configuration
Remove automatic port validation - just use port 4020 as default if not set in UserDefaults, otherwise use the configured port. Also removed debug logging added in previous commits.
This commit is contained in:
parent
7bffb2ae7b
commit
1048e21083
2 changed files with 1 additions and 15 deletions
|
|
@ -34,13 +34,11 @@ public final class TunnelServer {
|
|||
|
||||
public init(port: Int = 4020) {
|
||||
self.port = port
|
||||
logger.info("TunnelServer initialized with port: \(port)")
|
||||
}
|
||||
|
||||
public func start() async throws {
|
||||
guard !isRunning else { return }
|
||||
|
||||
logger.info("DEBUG: start() called with self.port = \(self.port)")
|
||||
logger.info("Starting TunnelServer on port \(port)")
|
||||
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -83,20 +83,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
|
||||
// Initialize and start HTTP server
|
||||
let serverPortString = UserDefaults.standard.string(forKey: "serverPort") ?? "4020"
|
||||
print("DEBUG: serverPortString from UserDefaults: '\(serverPortString)'")
|
||||
var serverPort = Int(serverPortString) ?? 4020
|
||||
|
||||
// Fix port 800 issue - ports below 1024 require root privileges
|
||||
if serverPort < 1024 {
|
||||
print("WARNING: Port \(serverPort) requires root privileges. Changing to 4020.")
|
||||
serverPort = 4020
|
||||
// Update UserDefaults with the correct port
|
||||
UserDefaults.standard.set(String(serverPort), forKey: "serverPort")
|
||||
}
|
||||
|
||||
print("DEBUG: Final serverPort: \(serverPort)")
|
||||
let serverPort = Int(serverPortString) ?? 4020
|
||||
httpServer = TunnelServer(port: serverPort)
|
||||
print("DEBUG: TunnelServer initialized with port: \(httpServer?.port ?? -1)")
|
||||
|
||||
Task {
|
||||
do {
|
||||
|
|
|
|||
Loading…
Reference in a new issue