Skip to content

Commit

Permalink
Set VPN flag properly
Browse files Browse the repository at this point in the history
Refine #2562.
  • Loading branch information
Mygod committed Jul 16, 2020
1 parent 8a70231 commit 0d75659
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/main/java/com/github/shadowsocks/bg/ProxyInstance.kt
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ class ProxyInstance(val profile: Profile, private val route: String = profile.ro

this.configFile = configFile
val config = profile.toJson()
val vpnFlags = if (service.isVpnService) ";V" else ""
plugin?.let { (path, opts) -> config.put("plugin", path).put("plugin_opts", opts.toString() + vpnFlags) }
plugin?.let { (path, opts) ->
if (service.isVpnService) opts["V"] = ""
config.put("plugin", path).put("plugin_opts", opts.toString())
}
config.put("local_address", DataStore.listenAddress)
config.put("local_port", DataStore.portProxy)
configFile.writeText(config.toString())
Expand Down

0 comments on commit 0d75659

Please sign in to comment.