Listen on IPv4 port 43112 by default
This commit is contained in:
1 parent
4801cfbe77
commit
0aad4f27eb
6 files changed
+44
-13
No files matched your search
@@ -22,7 +22,7 @@ private final class ServerControl: ObservableObject {
|
||||
@Published var starting = false
|
||||
@Published var stopping = false
|
||||
@Published var copying = false
|
||||
@Published var port = "55005"
|
||||
@Published var port = String(ServerConfiguration.defaultPort)
|
||||
@Published var notice: String?
|
||||
|
||||
private var configuration: ServerConfiguration?
|
||||
@@ -33,7 +33,12 @@ private final class ServerControl: ObservableObject {
|
||||
do {
|
||||
let configuration = try ServerConfiguration()
|
||||
self.configuration = configuration
|
||||
port = UserDefaults.standard.string(forKey: "listenPort") ?? String(configuration.port)
|
||||
let savedPort = UserDefaults.standard.string(forKey: "listenPort")
|
||||
if ProcessInfo.processInfo.environment["EZSERVER_PORT"] != nil || savedPort == "55005" {
|
||||
port = String(configuration.port)
|
||||
} else {
|
||||
port = savedPort ?? String(configuration.port)
|
||||
}
|
||||
start()
|
||||
} catch {
|
||||
notice = error.localizedDescription
|
||||
@@ -153,7 +158,7 @@ private struct ServerPanel: View {
|
||||
Divider()
|
||||
HStack {
|
||||
Text("Порт")
|
||||
TextField("55005", text: $model.port)
|
||||
TextField(String(ServerConfiguration.defaultPort), text: $model.port)
|
||||
.frame(width: 75)
|
||||
.disabled(model.running || model.starting || model.stopping)
|
||||
.accessibilityLabel("Порт HTTP")
|
||||
|
||||
Reference in new issue
Block a user