使用 TCP 协议进行 P2P 穿透,c++实现,无需公网IP,小巧,易用,快速,安全,最好的多链路聚合(p2p+proxy)模式,不做之一...这才是你真正想要的内网穿透工具!
|
|
1 week ago | |
|---|---|---|
| .github | 6 years ago | |
| client | 7 months ago | |
| dynamic | 1 week ago | |
| res | 1 year ago | |
| server | 6 years ago | |
| README_en.md | 1 year ago | |
| app-release.apk | 1 week ago | |
| linux_arm32v0.40.5.tar | 1 week ago | |
| linux_x86_64v0.40.5.tar | 1 week ago | |
| linux_x86v0.40.5.tar | 1 week ago | |
| readme.md | 1 month ago | |
| windows_x86v0.40.5.tar | 1 week ago |
... If this is what you want! Please continue reading patiently; if you have additional requirements, please raise an issue, and there's also interesting stuff in the [Update History].
Free, considering open source after stable testing.
Includes an Android client and a server that needs to be installed in the intranet.

Supports Proxy Penetration
If you have your own cloud server (with a public IP), you can customize your proxy server, and install proxy_server on the proxy server. All data transmission goes through the user-configured proxy server (the proxy server needs a certificate, which can be generated automatically or configured with an existing certificate).
1、Configuration of the "Proxy Server" is as follows (the proxy server must allow any port "inbound" connections):
<?xml version="1.0" encoding="GBK"?>
<app-config code="PROXY" name="proxy-server">
<app-parameter>
<proxy-service-port value="9001"/><!--Custom proxy port-->
<owner-id value="xxxx" /><!-- xxxx is the user ID returned after successful registration -->
<access-token value="nnnnn"/><!--Access token, must be a number [optional] -->
<ssl-create-certfile value="true" /><!-- If the following options are not used to specify the certificate, it will be generated automatically [Must ensure that openssl is installed], default is false meaning no need to generate -->
<!-- If you have a certificate and private key, configure the following items. Start a secure SSL channel. The file names need to be configured correctly. If there is no certificate, no need to configure. Enable the above option to generate the certificate automatically.
<ssl-cacert-file value="xxx.crt"/>
<ssl-privatekey-file value="xxx.key"/>
-->
</app-parameter>
<module-parameter>
<log-level value="LOG_ERROR"/>
<log-write-mode value="CONSOLE_ONLY"/>
</module-parameter>
</app-config>
2. Add the following configuration to the "Server":
......
<app-parameter>
<ssl-create-certfile value="true" />
<!-- If the proxy server starts a secure SSL channel, you must configure the certificate and private key here.
<ssl-cacert-file value="xxx.crt"/>
<ssl-privatekey-file value="xxx.key"/>
-->
</app-parameter>
<module-parameter>
......
</module-parameter>
<!-- Configure the IP or domain name + port of the proxy server mentioned above. Note: the IP must be a public IP. The ssl option must be configured correctly. If the proxy server has a certificate (including automatically generated certificates) and is effective, configure it as true, otherwise, it is false -->
<channel address="xxx.xxx.xxx.xxx:9001" ssl="true" token="nnnnn" /><!--Access token, must match the proxy server, if not, no need to configure -->
Supports P2P Channel
<th>Server NAT</th><th>Client NAT</th><th>P2P Success</th>
<tr><td>NAT1-3</td><td>NAT1-3</td><td>YES</td></tr>
<tr><td>NAT1-2</td><td>NAT4</td><td>YES</td></tr>
<tr><td>NAT4</td><td>NAT1-2</td><td>YES</td></tr>
<tr><td>NAT4</td><td>NAT3-4</td><td>NO</td></tr>
<tr><td>NAT3-4</td><td>NAT4</td><td>NO</td></tr>
Supports TCP-based P2P connection tunnels
Supports all types of protocols based on TCP for "transparent proxy"
Supports HTTP, HTTPS to HTTP
Supports UDP over TCP
Transparent mode (no need to focus on IPv6 addresses) supports IPv6 tunnel
Supports custom proxy (requires public IP), taking over all data forwarding
Custom proxy supports token and whitelist configuration
Supports multi-level cascading proxy
Supports mobile phones as the only access point — Secure + Mobile Convenience
Dynamic configuration for port mapping, supports "hot-plugging" of mapping configurations
All features are "one-point configuration" on the app side
Supports automatic detection and connection of P2P tunnels and custom proxy tunnels
Supports dynamic negotiation of ports, supports specifying negotiated ports
Supports tunnel connection priority (P2P -> Custom Proxy -> Official Proxy)
Supports SSL encrypted tunnel
Supports traffic limitation
Supports network switching (e.g., mobile <-> Wi-Fi) automatic identification + automatic connection
Supports port mapping between different LAN hosts — If one end host has a public IP, it can be accessed directly from the external network (version > v0.31)
App supports server mode, can configure the phone as a server
Supports remote file management functionality: browsing, uploading, downloading, deleting, supports resuming downloads (version >= v0.31.6)
Supports built-in SOCKS5, HTTP proxies (version >= v0.32.1)
SOCKS5, HTTP proxies support domain and IP whitelists (version >= v0.32.1)
... To be continued
chmod +x proxy_server && nohup ./proxy_server -i1000 -o1000 -w8 >/dev/null &proxy_server.exe -i1000 -o1000 -w8Phone settings (Android):
Q: How to download and install the Android app?
A: Open the link https://github.com/lazy-luo/smarGate/raw/master/app-release.apk in the browser of your Android phone, and then install it when prompted. B: Pan.baidu.com download link for the latest test version: https://pan.baidu.com/s/14Iq60kxHW711NVoCVKWySg C: Gitee address (faster download speed, no issues with image display): https://gitee.com/lazy-luo/smarGate D: If needed, add WeChat: ws_lzy008, specifying "smarGate". Depending on the situation, a technical discussion group may be formed.
Q: Do I need to install the server on every device at home to access multiple devices on the local network?
A: No, you only need to install the server on any one device.
Q: Why sometimes unable to connect?
A: The server will automatically disconnect after about 2-3 minutes of idle time and will reconnect after waiting for about 10 seconds.
Q: Why can't I establish a P2P connection over IPv6?
A: Please update both the client and server to the latest version; make sure your phone and the internal computer can obtain a global IPv6 address; ensure it is not blocked by the firewall (Windows); check if both IPv6 can be routed out; and check the hosts file to ensure the hostname resolves to the IPv6 address.
Q: Why does P2P connection over IPv4 and IPv6 not have UDP ports?
A: smarGate uses TCP protocol for P2P penetration, which provides better security and connection reliability.
Q: Why can't the phone NAS client log in?
A: Make sure the phone NAS client's IP is not blacklisted, and it does not include "localhost" (127.0.0.1).
Q: How to share machines in a remote company network with multiple teams in different locations?
A: Connect the phone to Wi-Fi, let team members' computers connect to the phone's IP: PORT, and access directly through the phone's proxy. Tested on phones with 2k resolution or higher, it can support sharing access for up to a hundred people.
Q: Why doesn't the Windows server have a console window?
A: To prevent accidental shutdown of the server, the new version of the Windows server runs in the background. If you need to close it, use "Task Manager".
Q: Do I still need to go through an intermediate proxy when using P2P?
A: No, connect directly point-to-point, and the network speed depends on the networks of your client and server.
Q: Does smarGate consume a lot of power when running in the background?
A: After long-term testing, for occasional use, the power consumption is similar to any system process, extremely low. In the case of frequent background use, the overall power consumption is equivalent to occasional use of WeChat. The power management prompt "Frequent background refresh..." can be ignored; it appears whenever there is background data transfer, and the key is to look at the power consumption ranking.
Q: What are the connection priority rules in smarGate?
A: Prefer P2P connection. If there is no P2P, use a custom proxy connection. If neither of the previous two connects, use the official proxy connection.
Q: Can the same user log in from multiple locations?
A: Multiple logins are allowed, but only one client can perform P2P at a time. Each server machine can only run one instance, and the configuration of each instance ensures that the serial number is not duplicated, otherwise it will not work properly.
Q: Can the server support Android phones?
A: The Android app version 0.27 has added support for "server mode".
Q: What does the different color represent in the client?
A: P2P identification under IPv4:
A: P2P identification under IPv6:
A: User-defined proxy identification:
If you find smarGate helpful, feel free to make a donation to support the long-term development of the project! Note: It is recommended to include your registered username with the donation.