refactor proxy

This commit is contained in:
Aria Moradi 2021-03-28 20:41:39 +04:30
parent e6ba2a0066
commit b1b1abad1d
3 changed files with 12 additions and 10 deletions

View File

@ -16,7 +16,7 @@ class ServerConfig(config: Config) : ConfigModule(config) {
val port: Int by config val port: Int by config
// proxy // proxy
val socksProxy: Boolean by config val socksProxyEnabled: Boolean by config
val socksProxyHost: String by config val socksProxyHost: String by config
val socksProxyPort: String by config val socksProxyPort: String by config

View File

@ -95,7 +95,9 @@ fun applicationSetup() {
System.setProperty("org.eclipse.jetty.LEVEL", "OFF") System.setProperty("org.eclipse.jetty.LEVEL", "OFF")
// socks proxy settings // socks proxy settings
System.getProperties()["proxySet"] = serverConfig.socksProxy.toString() if (serverConfig.socksProxyEnabled) {
System.getProperties()["proxySet"] = "true"
System.getProperties()["socksProxyHost"] = serverConfig.socksProxyHost System.getProperties()["socksProxyHost"] = serverConfig.socksProxyHost
System.getProperties()["socksProxyPort"] = serverConfig.socksProxyPort System.getProperties()["socksProxyPort"] = serverConfig.socksProxyPort
}
} }

View File

@ -3,7 +3,7 @@ server.ip = "0.0.0.0"
server.port = 4567 server.port = 4567
# Socks5 proxy # Socks5 proxy
server.socksProxy = false server.socksProxyEnabled = false
server.socksProxyHost = "" server.socksProxyHost = ""
server.socksProxyPort = "" server.socksProxyPort = ""