Skip to content

Commit f5e2087

Browse files
committed
fix: update proxy configuration in test.yml and test_proxy.py; change port to 8443 to avoid permission issues
1 parent 1faa204 commit f5e2087

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959
echo "Using secret: $SECRET"
6060
6161
# Start proxy in background
62-
./mtproto-proxy -u nobody -p 8888 -H 443 -S $SECRET --http-stats --aes-pwd proxy-secret proxy-multi.conf -M 1 &
62+
# Use port 8443 instead of 443 to avoid permission issues or conflicts on the runner
63+
./mtproto-proxy -u nobody -p 8888 -H 8443 -S $SECRET --http-stats --aes-pwd proxy-secret proxy-multi.conf -M 1 &
6364
6465
# Export SECRET for the test step
6566
echo "MTPROXY_SECRET=$SECRET" >> $GITHUB_ENV
@@ -77,5 +78,6 @@ jobs:
7778
# We need to tell the test script to connect to localhost since we are not in docker-compose
7879
# We can do this by setting an env var or modifying the script to fallback to localhost
7980
export MTPROXY_HOST=localhost
81+
export MTPROXY_PORT=8443
8082
python3 tests/test_proxy.py
8183

tests/test_proxy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_http_stats():
3535
def test_mtproto_port():
3636
print("Testing MTProto port...")
3737
host = os.environ.get("MTPROXY_HOST", "mtproxy")
38-
port = 443
38+
port = int(os.environ.get("MTPROXY_PORT", 443))
3939
try:
4040
ip = socket.gethostbyname(host)
4141
print(f"Connecting to {ip}:{port}")
@@ -65,6 +65,7 @@ async def test_telethon():
6565
print(f"Connecting to proxy with secret: {secret}")
6666

6767
host = os.environ.get("MTPROXY_HOST", "mtproxy")
68+
port = int(os.environ.get("MTPROXY_PORT", 443))
6869

6970
try:
7071
# Use MemorySession since we don't need to persist session
@@ -76,7 +77,7 @@ async def test_telethon():
7677
int(api_id),
7778
api_hash,
7879
connection=ConnectionTcpMTProxyIntermediate,
79-
proxy=(host, 443, secret)
80+
proxy=(host, port, secret)
8081
)
8182

8283
print("Connecting to Telegram via Proxy...")

0 commit comments

Comments
 (0)