Commit dd2abac2 authored by chenhuaqing's avatar chenhuaqing

refine passing network interface args

parent 403f72fe
...@@ -101,6 +101,9 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro ...@@ -101,6 +101,9 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro
}) })
} }
}) })
if (DataStore.outboundBindInterface.isNotBlank()) {
config.put("outbound-bind-interface", DataStore.outboundBindInterface)
}
configFile.writeText(config.toString()) configFile.writeText(config.toString())
Timber.d("prepare start service with config: $config") Timber.d("prepare start service with config: $config")
......
...@@ -107,4 +107,7 @@ object DataStore : OnPreferenceDataStoreChangeListener { ...@@ -107,4 +107,7 @@ object DataStore : OnPreferenceDataStoreChangeListener {
var dirty: Boolean var dirty: Boolean
get() = privateStore.getBoolean(Key.dirty) ?: false get() = privateStore.getBoolean(Key.dirty) ?: false
set(value) = privateStore.putBoolean(Key.dirty, value) set(value) = privateStore.putBoolean(Key.dirty, value)
var outboundBindInterface: String
get() = privateStore.getString(Key.outboundBindInterface) ?: ""
set(value) = privateStore.putString(Key.outboundBindInterface, value)
} }
...@@ -65,6 +65,7 @@ object Key { ...@@ -65,6 +65,7 @@ object Key {
const val plugin = "plugin" const val plugin = "plugin"
const val pluginConfigure = "plugin.configure" const val pluginConfigure = "plugin.configure"
const val udpFallback = "udpFallback" const val udpFallback = "udpFallback"
const val outboundBindInterface = "outboundBindInterface"
const val dirty = "profileDirty" const val dirty = "profileDirty"
......
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