Skip to content

Commit

Permalink
LinkHelper#inbounds: added accounts to socks settings
Browse files Browse the repository at this point in the history
  • Loading branch information
SaeedDev94 committed Sep 2, 2024
1 parent a67ab22 commit 781ddb8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/src/main/java/io/github/saeeddev94/xray/helper/LinkHelper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,19 @@ class LinkHelper(link: String) {
socks.put("listen", Settings.socksAddress)
socks.put("port", Settings.socksPort.toInt())
socks.put("protocol", "socks")

val settings = JSONObject()
settings.put("udp", true)
if (Settings.socksUsername.trim().isNotEmpty() && Settings.socksPassword.trim().isNotEmpty()) {
val account = JSONObject()
account.put("user", Settings.socksUsername)
account.put("pass", Settings.socksPassword)
val accounts = JSONArray()
accounts.put(account)

settings.put("auth", "password")
settings.put("accounts", accounts)
}

val sniffing = JSONObject()
sniffing.put("enabled", true)
Expand Down

0 comments on commit 781ddb8

Please sign in to comment.