Compare commits

...

4 Commits

Author SHA1 Message Date
Flowseal 70b982da2c Bump version 2026-09-19 22:51:47 +03:00
Flowseal 5226a409d4 clarify dialog message 2026-09-19 22:49:57 +03:00
Flowseal e519c4df4c use certifi for tls connections, fixes #1348 2026-09-19 22:48:25 +03:00
Flowseal a0605c7447 removed debug print closes #1350 2026-09-19 22:41:37 +03:00
6 changed files with 13 additions and 12 deletions
+4 -4
View File
@@ -4,8 +4,8 @@
# http://msdn.microsoft.com/en-us/library/ms646997.aspx # http://msdn.microsoft.com/en-us/library/ms646997.aspx
VSVersionInfo( VSVersionInfo(
ffi=FixedFileInfo( ffi=FixedFileInfo(
filevers=(1, 10, 3, 0), filevers=(1, 10, 4, 0),
prodvers=(1, 10, 3, 0), prodvers=(1, 10, 4, 0),
mask=0x3f, mask=0x3f,
flags=0x0, flags=0x0,
OS=0x40004, OS=0x40004,
@@ -21,12 +21,12 @@ VSVersionInfo(
[ [
StringStruct(u'CompanyName', u'Flowseal'), StringStruct(u'CompanyName', u'Flowseal'),
StringStruct(u'FileDescription', u'Telegram Desktop WebSocket Bridge Proxy'), StringStruct(u'FileDescription', u'Telegram Desktop WebSocket Bridge Proxy'),
StringStruct(u'FileVersion', u'1.10.3.0'), StringStruct(u'FileVersion', u'1.10.4.0'),
StringStruct(u'InternalName', u'TgWsProxy'), StringStruct(u'InternalName', u'TgWsProxy'),
StringStruct(u'LegalCopyright', u'Copyright (c) Flowseal. MIT License.'), StringStruct(u'LegalCopyright', u'Copyright (c) Flowseal. MIT License.'),
StringStruct(u'OriginalFilename', u'TgWsProxy.exe'), StringStruct(u'OriginalFilename', u'TgWsProxy.exe'),
StringStruct(u'ProductName', u'TG WS Proxy'), StringStruct(u'ProductName', u'TG WS Proxy'),
StringStruct(u'ProductVersion', u'1.10.3.0'), StringStruct(u'ProductVersion', u'1.10.4.0'),
] ]
) )
] ]
+1 -1
View File
@@ -1,6 +1,6 @@
from .config import parse_dc_ip_list, proxy_config, coerce_domain_list from .config import parse_dc_ip_list, proxy_config, coerce_domain_list
from .utils import get_link_host, build_github_opener from .utils import get_link_host, build_github_opener
__version__ = "1.10.3" __version__ = "1.10.4"
__all__ = ["__version__", "get_link_host", "proxy_config", "parse_dc_ip_list", "build_github_opener", "coerce_domain_list"] __all__ = ["__version__", "get_link_host", "proxy_config", "parse_dc_ip_list", "build_github_opener", "coerce_domain_list"]
+4 -4
View File
@@ -1,5 +1,6 @@
import os import os
import ssl import ssl
import certifi
import logging import logging
import base64 import base64
import struct import struct
@@ -21,8 +22,8 @@ _st_BBQ4s = struct.Struct('>BBQ4s')
_st_H = struct.Struct('>H') _st_H = struct.Struct('>H')
_st_Q = struct.Struct('>Q') _st_Q = struct.Struct('>Q')
_ssl_ctx = ssl.create_default_context() _ssl_ctx = ssl.create_default_context(cafile=certifi.where())
_ssl_ctx_fronting = ssl.create_default_context() _ssl_ctx_fronting = ssl.create_default_context(cafile=certifi.where())
_ssl_ctx_fronting.check_hostname = False _ssl_ctx_fronting.check_hostname = False
class WsHandshakeError(Exception): class WsHandshakeError(Exception):
@@ -88,7 +89,6 @@ class RawWebSocket:
path: str = '/apiws', *, path: str = '/apiws', *,
sni: Optional[str] = None, secure = True) -> 'RawWebSocket': sni: Optional[str] = None, secure = True) -> 'RawWebSocket':
ssl = _ssl_ctx_fronting if sni else _ssl_ctx ssl = _ssl_ctx_fronting if sni else _ssl_ctx
print(f"Connecting to {host} with secure={secure}, sni={sni}, path={path}")
if sni is None: if sni is None:
sni = domain sni = domain
@@ -291,4 +291,4 @@ class RawWebSocket:
payload = await self.reader.readexactly(length) payload = await self.reader.readexactly(length)
return opcode, _xor_mask(payload, mask_key), fin return opcode, _xor_mask(payload, mask_key), fin
payload = await self.reader.readexactly(length) payload = await self.reader.readexactly(length)
return opcode, payload, fin return opcode, payload, fin
+2 -1
View File
@@ -48,9 +48,10 @@ def _run_connectivity_test(cases: list, *, secure: bool = True) -> dict:
import base64 import base64
from contextlib import nullcontext from contextlib import nullcontext
import ssl import ssl
import certifi
import socket as _socket import socket as _socket
ctx = ssl.create_default_context() if secure else None ctx = ssl.create_default_context(cafile=certifi.where()) if secure else None
port = 443 if secure else 80 port = 443 if secure else 80
results = {} results = {}
for dc, connect_host, sni_host, req_host, path in cases: for dc, connect_host, sni_host, req_host, path in cases:
+1 -1
View File
@@ -120,7 +120,7 @@
"dialog.restart_title": "Restart?", "dialog.restart_title": "Restart?",
"dialog.restart_body": "Settings saved.\n\nRestart the proxy now?", "dialog.restart_body": "Settings saved.\n\nRestart the proxy now?",
"dialog.already_running": "Application is already running.", "dialog.already_running": "Application is already running, check the tray",
"dialog.log_not_found": "Log file has not been created yet.", "dialog.log_not_found": "Log file has not been created yet.",
"dialog.ctk_missing": "customtkinter is not installed.", "dialog.ctk_missing": "customtkinter is not installed.",
"dialog.copy_ok": "Link copied to clipboard, send it in Telegram and click it:\n{url}", "dialog.copy_ok": "Link copied to clipboard, send it in Telegram and click it:\n{url}",
+1 -1
View File
@@ -120,7 +120,7 @@
"dialog.restart_title": "Перезапустить?", "dialog.restart_title": "Перезапустить?",
"dialog.restart_body": "Настройки сохранены.\n\nПерезапустить прокси сейчас?", "dialog.restart_body": "Настройки сохранены.\n\nПерезапустить прокси сейчас?",
"dialog.already_running": "Приложение уже запущено.", "dialog.already_running": "Приложение уже запущено, проверьте трей.",
"dialog.log_not_found": "Файл логов ещё не создан.", "dialog.log_not_found": "Файл логов ещё не создан.",
"dialog.ctk_missing": "customtkinter не установлен.", "dialog.ctk_missing": "customtkinter не установлен.",
"dialog.copy_ok": "Ссылка скопирована в буфер обмена, отправьте её в Telegram и нажмите по ней ЛКМ:\n{url}", "dialog.copy_ok": "Ссылка скопирована в буфер обмена, отправьте её в Telegram и нажмите по ней ЛКМ:\n{url}",