Commit a64eb8ac authored by Max Lv's avatar Max Lv

Forward DNS packet to dnsgw

parent 9ab92309
Subproject commit 057ed9f36490a9dccd5e7337fabcb142dd3afc0d Subproject commit af4a5647eaa7263087d79817b38fc084e2206311
...@@ -317,7 +317,7 @@ trait BaseService extends Service { ...@@ -317,7 +317,7 @@ trait BaseService extends Service {
protected final def buildOvertureConfig(file: String): String = { protected final def buildOvertureConfig(file: String): String = {
val config = new JSONObject() val config = new JSONObject()
.put("BindAddress", "0.0.0.0:" + (profile.localPort + 53)) .put("BindAddress", "127.0.0.1:" + (profile.localPort + 53))
.put("RedirectIPv6Record", true) .put("RedirectIPv6Record", true)
.put("DomainBase64Decode", true) .put("DomainBase64Decode", true)
.put("HostsFile", "hosts") .put("HostsFile", "hosts")
......
...@@ -143,7 +143,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -143,7 +143,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
/** Called when the activity is first created. */ /** Called when the activity is first created. */
def handleConnection() { def handleConnection() {
startShadowsocksDaemon() startShadowsocksDaemon()
if (!profile.udpdns) { if (!profile.udpdns) {
...@@ -247,7 +247,7 @@ class ShadowsocksVpnService extends VpnService with BaseService { ...@@ -247,7 +247,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
cmd += "--enable-udprelay" cmd += "--enable-udprelay"
if (!profile.udpdns) if (!profile.udpdns)
cmd += ("--dnsgw", "%s:%d".formatLocal(Locale.ENGLISH, PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), cmd += ("--dnsgw", "%s:%d".formatLocal(Locale.ENGLISH, "127.0.0.1",
profile.localPort + 53)) profile.localPort + 53))
tun2socksProcess = new GuardedProcess(cmd: _*).start(() => sendFd(fd)) tun2socksProcess = new GuardedProcess(cmd: _*).start(() => sendFd(fd))
......
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