Commit f799649f authored by Mygod's avatar Mygod

Bind 0.0.0.0 on Chrome OS

This is fine since there Android subsystem runs in a container.
parent 574ed7da
...@@ -81,14 +81,10 @@ object DataStore : OnPreferenceDataStoreChangeListener { ...@@ -81,14 +81,10 @@ object DataStore : OnPreferenceDataStoreChangeListener {
false false
} }
/** /**
* We hardcode bogus IP address 100.115.92.2 in Chrome OS as this IP may not be available when the device is not * Binding bogus IP address 100.115.92.2 in Chrome OS directly does not seem to work reliably. It might be due to
* connected to any network. * the IP may not be available when the device is not connected to any network.
*/ */
val listenAddress get() = when { val listenAddress get() = if (publicStore.getBoolean(Key.shareOverLan, hasArc0)) "0.0.0.0" else "127.0.0.1"
publicStore.getBoolean(Key.shareOverLan, false) -> "0.0.0.0"
hasArc0 -> "100.115.92.2"
else -> "127.0.0.1"
}
var portProxy: Int var portProxy: Int
get() = getLocalPort(Key.portProxy, 1080) get() = getLocalPort(Key.portProxy, 1080)
set(value) = publicStore.putString(Key.portProxy, value.toString()) set(value) = publicStore.putString(Key.portProxy, value.toString())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment