Skip to content

Commit

Permalink
Release 5.0.6 fix bugs and improve usability.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-X-Net committed Jan 29, 2023
1 parent 3a09f05 commit d659e4d
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 26 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# XX-Net (翻墙VPN)
* 靠谱的翻墙系统
* 连续7年可靠工作
* 高速下载,稳定不掉线
* 可靠稳定的的翻墙系统,已经连续8年可靠提供服务
* 支持Android/iOS/Windows/Mac/Linux

<br>

### 主页(客户端下载): [https://xx-net.com](https://xx-net.com)
### 电报群: [https://t.me/xxnetshare](**https://xx-net.com**)
### 官网下载: [https://xx-net.com](https://xx-net.com)
### Telegram: [https://t.me/xxnetshare](https://t.me/xxnetshare)
### Twitter: [https://twitter.com/XXNetDev](https://twitter.com/XXNetDev)
###
###### [中文帮助文档](https://github.com/XX-net/XX-Net/wiki/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3) &nbsp; &nbsp; &nbsp;[English Document](https://github.com/XX-net/XX-Net/wiki/English-Home-Page) &nbsp; &nbsp; &nbsp;[فارسی صفحه اصلی](https://github.com/XX-net/XX-Net/wiki/Persian-home-page)
Expand All @@ -15,7 +15,7 @@

### 最新公告:
2023-01-13
* 新版 5.0.5,提升稳定性和性能,推荐大家重新下载安装,不要应用内升级
* 新版 5.0.6,提升稳定性和性能,4.x.x 的需要重新下载安装,不能应用内升级
* 免费用户可以无限流量访问google, Wikipedia 和 twitter,但部分地区(比如上海、北京)封锁严重,需要购买套餐才能连接接。
* GAE 模块需要手动开启.
没有绑卡无法工作, 想使用GAE模块请手动启用, 老id需要重新部署。
Expand Down
2 changes: 1 addition & 1 deletion code/default/update_v5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ https://codeload.github.com/XX-net/XX-Net/zip/5.0.5 8a2f4ee9421517e6f0bdf9d0a9fa


稳定版(Stable):
https://codeload.github.com/XX-net/XX-Net/zip/5.0.1 619630f8819509702f9b765c69636d43cc0801106bc0dd915440276ef167a2a7
https://codeload.github.com/XX-net/XX-Net/zip/5.0.5 8a2f4ee9421517e6f0bdf9d0a9fadffbbd7e4db11c88ef605559acbf5e0c223c
2 changes: 1 addition & 1 deletion code/default/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.5
5.0.6
6 changes: 5 additions & 1 deletion code/default/x_tunnel/local/front_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def init():


def save_cloudflare_domain(domains):
if not domains or not g.config.enable_cloudflare:
if not g.config.enable_cloudflare:
xlog.warn("save_cloudflare_domain but cloudflare front not enabled")
return

if not domains:
xlog.warn("save_cloudflare_domain fail, domains:%s enable:%d", domains, g.config.enable_cloudflare)
return

Expand Down
11 changes: 8 additions & 3 deletions code/default/x_tunnel/local/tls_relay_front/ip_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@ def get_ip(self):
port = self.host_manager.info[ip].get("port", 443)
return ip + ":" + str(port)

def split_the_ip(self, ip_str):
ips = ip_str.split(":")[0:-1]
ip = ":".join(ips)
return ip

def report_connect_fail(self, ip_str, reason=""):
ip = ip_str.split(":")[0]
ip = self.split_the_ip(ip_str)
self.ip_dict[ip]["fail_times"] += 1
self.ip_dict[ip]["links"] -= 1
self.logger.debug("ip %s connect fail", ip)

def update_ip(self, ip_str, handshake_time):
ip = ip_str.split(":")[0]
ip = self.split_the_ip(ip_str)
self.ip_dict.setdefault(ip, {
"fail_times": 0,
"success_times": 0
Expand All @@ -44,7 +49,7 @@ def update_ip(self, ip_str, handshake_time):
self.logger.debug("ip %s connect success", ip)

def ssl_closed(self, ip_str, reason=""):
ip = ip_str.split(":")[0]
ip = self.split_the_ip(ip_str)
self.ip_dict[ip]["links"] -= 1
self.logger.debug("ip %s connect closed", ip)

Expand Down
28 changes: 14 additions & 14 deletions code/default/x_tunnel/local/web_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def req_token_login_handler(self):
data = json.loads(utils.to_str(login_str))
username = data["login_account"]
password_hash = data["login_password"]
cloudflare_domains = data["cloudflare_domains"]
cloudflare_domains = data.get("cloudflare_domains")
tls_relay = data["tls_relay"]
except Exception as e:
xlog.warn("token_login except:%r", e)
Expand All @@ -269,7 +269,7 @@ def req_token_login_handler(self):
"reason": "Password format fail"
})

if g.config.update_cloudflare_domains:
if g.config.update_cloudflare_domains and cloudflare_domains:
g.http_client.save_cloudflare_domain(cloudflare_domains)
if g.tls_relay_front and tls_relay.get("ips"):
g.tls_relay_front.set_ips(tls_relay["ips"])
Expand Down Expand Up @@ -439,18 +439,18 @@ def is_server_available(server):
server = str(self.postvars['server'][0])
server = '' if server == 'auto' else server

promoter = self.postvars.get("promoter", [""])[0]
if promoter != g.promoter:
res, info = proxy_session.call_api("/set_config", {
"account": g.config.login_account,
"password": g.config.login_password,
"promoter": promoter
})
if not res:
xlog.warn("set_config fail:%s", info)
return self.response_json({"res": "fail", "reason": info})
else:
g.promoter = promoter
# promoter = self.postvars.get("promoter", [""])[0]
# if promoter != g.promoter:
# res, info = proxy_session.call_api("/set_config", {
# "account": g.config.login_account,
# "password": g.config.login_password,
# "promoter": promoter
# })
# if not res:
# xlog.warn("set_config fail:%s", info)
# return self.response_json({"res": "fail", "reason": info})
# else:
# g.promoter = promoter

if is_server_available(server):
if server != g.config.server_host:
Expand Down

0 comments on commit d659e4d

Please sign in to comment.