Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Proxy-Only Mode and Transproxy Mode #1446

Merged
merged 7 commits into from
Nov 13, 2017
Merged

Implement Proxy-Only Mode and Transproxy Mode #1446

merged 7 commits into from
Nov 13, 2017

Conversation

Mygod
Copy link
Contributor

@Mygod Mygod commented Nov 11, 2017

Type of changes

  • General refinement

Details

With which we finally deprecate NAT mode. Fixes #805. Fixes #1441.

  • NAT mode is replaced by transproxy mode;
  • BaseService classes are moved into bg package and refactored in order to minimize duplicate code;
  • Local port is moved out of per-profile settings, along with hardcoded DNS port and transproxy (redsocks) port;
  • Reset is removed since the only possible clean-up needed can be performed by using force stop in app info;
  • Comparing version code before extracting assets is replaced with a more robust approach: comparing update time.

NB: the only code that involves su now is for toggling TFO.

Possible usecases

Proxy-only mode: Use as an upstream proxy for other proxies.
VPN mode: Mostly unchanged.
Transproxy mode: Meant to be used with AFWall+.

Because I'm lazy, I will call them POM, VPN, TPM from now on.

Here's a way to test POM (and possibly useful too since one could also use it under other modes):

  1. Connect to Android using adb;
  2. Set up port forwarding:
$ adb forward tcp:<local socks port> tcp:<shadowsocks-android listening port>
  1. Test out Shadowsocks connection. 😄

TODO

Do not merge yet. Need more testing and fixing these TODOs.

  • Transproxy script for AFWall+: this could be based on this script. We could put this file somewhere in this project (firewall-shadowsocks-all.sh or scripts/fireweall-shadowsocks-all.sh etc.). It seems like we could also provide IPv6 support for TPM using ip6table.
  • After that, we might need to write a guide for using this new mode, like this tutorial;
  • Technically we could also implement a basic connection test for other two modes:
    • POM: Just route the traffic through SOCKS5 proxy;
    • TPM: Do DNS lookup using local DNS and then route the traffic through SOCKS5 proxy (or if possible send it to redsocks?)

@madeye Would you like to work on these? 😄

* NAT mode is replaced by transproxy mode;
* BaseService classes are moved into bg package and refactored in order to minimize duplicate code;
* Local port is moved out of per-profile settings, along with hardcoded DNS port and transproxy (redsocks) port;
* Reset is removed since the only possible clean-up needed can be performed by using force stop in app info;
* Comparing version code before extracting assets is replaced with a more robust approach: comparing update time.

NB: the only code that involves su now is for toggling TFO.
@Mygod Mygod requested a review from madeye November 11, 2017 08:26
@Mygod Mygod changed the title Implement proxy mode and transproxy mode Implement Proxy-Only Mode and Transproxy Mode Nov 11, 2017
@madeye
Copy link
Contributor

madeye commented Nov 11, 2017

IMO, connection test is not necessary.

I'll test these changes first.

@Mygod
Copy link
Contributor Author

Mygod commented Nov 12, 2017

It's good to merge now.

@@ -12,7 +12,7 @@
android:required="false"/>
<uses-feature android:name="android.software.leanback"
android:required="false"/>
<uses-feature android:name="android.hardware.camera"
<uses-feature android:name="android.hardware.camera"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why space here?

Copy link
Contributor Author

@Mygod Mygod Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@madeye can handle it if he decides to merge

@madeye madeye merged commit 265ecc0 into master Nov 13, 2017
@Mygod Mygod deleted the transproxy branch November 13, 2017 03:42
FakeTrader pushed a commit to FakeTrader/shadowsocks-android that referenced this pull request Aug 21, 2018
Implement Proxy-Only Mode and Transproxy Mode
bannedbook pushed a commit to bannedbook/SpeedUp.VPN that referenced this pull request Dec 25, 2019
Implement Proxy-Only Mode and Transproxy Mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manual mode request Proxy-only mode should be added to work with adblockers and Orbot.
3 participants