Add SOCKS5 password protection for local proxy interface (RFC 1929)#3243
Draft
Add SOCKS5 password protection for local proxy interface (RFC 1929)#3243
Conversation
Agent-Logs-Url: https://github.com/shadowsocks/shadowsocks-android/sessions/d496275b-6490-48b5-8dd9-acbbd50734ae Co-authored-by: madeye <627917+madeye@users.noreply.github.com>
Agent-Logs-Url: https://github.com/shadowsocks/shadowsocks-android/sessions/d496275b-6490-48b5-8dd9-acbbd50734ae Co-authored-by: madeye <627917+madeye@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add password protection for SOCKS interface
Add SOCKS5 password protection for local proxy interface (RFC 1929)
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Any app on the device can use the local SOCKS5 proxy (default port 1080) without authentication, enabling unauthorized traffic routing and potential VPN IP leakage. This adds optional RFC 1929 username/password authentication to the local SOCKS5 interface.
How it works
ss-localis configured with asocks5_auth_config_pathpointing to a generated auth config file (username:shadowsocks, password: user-configured)tun2socksreceives--username/--passwordso VPN mode continues to work transparentlyChanges
Constants.kt/DataStore.kt:socksPasswordkey and property backed bypublicStoreProxyInstance.kt: Writessocks5_authJSON config file and addssocks5_auth_config_pathto the local SOCKS5 listener config when password is set; cleans up on shutdownVpnService.kt: Passes--username shadowsocks --password <pwd>to tun2socks when password is setpref_global.xml/pref_main.xml:EditTextPreference(password dialog) for the new settingGlobalSettingsPreferenceFragment.kt/MainPreferenceFragment.kt: Password preference disabled while service is runningAuth config format written to
socks5_auth{ "password": { "users": [{ "user_name": "shadowsocks", "password": "<user-configured>" }] } }Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.foojay.io/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath \"\" -jar /home/REDACTED/work/shadowsocks-android/shadowsocks-android/gradle/wrapper/gradle-wrapper.jar :core:compileDebugKotlin /main/java/com/g--norc /main/java/com/g--noprofile /main/java/com/github/shadowsocks/tv/App.kt rc/s�� /src/test/java/com/github/shadowsocks/plugin/PluginOptionsTest.kt /src/main/java/com/github/shadowsocks/plugin/Utils.kt /src/main/java/com/github/shadowsocks/plugin/AlertDialogFragment.kt /src/main/java/cgit /src/main/java/cls-files /src/main/java/c--exclude-standard /src/main/java/c--others(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath \"\" -jar /home/REDACTED/work/shadowsocks-android/shadowsocks-android/gradle/wrapper/gradle-wrapper.jar :core:compileDebugKotlin -Porg.gradle.java.installations.auto-provision=false om/github/shadowsocks/plugin/HelpCallback.kt om/github/shadowsocks/plugin/PluginContract.kt om/g�� om/github/shadowsocks/plugin/PluginOptions.kt om/github/shadowsocks/plugin/HelpActivity.kt /src/main/res/values-ru/strings.xml /src/main/res/vaiptables /src/main/res/va-w /src/main/res/va-t /src/main/res/vasecurity(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -Xmx64m -Xms64m -Dorg.gradle.appname=gradlew -classpath \"\" -jar /home/REDACTED/work/shadowsocks-android/shadowsocks-android/gradle/wrapper/gradle-wrapper.jar :core:compileDebugKotlin --no-daemon -Dorg.gradle.java.home=/usr/lib/jvm/temurin-17-jdk-amd64(dns block)If you need me to access, download, or install something from one of these locations, you can either: