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

Socks5 proxy for all panel traffic #71

Open
softfan2019 opened this issue Jan 4, 2025 · 4 comments
Open

Socks5 proxy for all panel traffic #71

softfan2019 opened this issue Jan 4, 2025 · 4 comments

Comments

@softfan2019
Copy link

Hi,
Is it possible to have an option to tunnel all panel traffic through a socks5 proxy? It seems that my hosting is blocking telegram traffic. I have a XUi panel on same server that is working so if a option to tunnel all traffic through socks5 proxy is possible I could use it to connect to Telegram server.

Thanks

@eloravpn
Copy link
Owner

eloravpn commented Jan 4, 2025

Hello, please check https://github.com/eloravpn/EloraVPNManager/blob/main/src/config.py.
You can configure the TELEGRAM_PROXY_URL in the .env file, for instance: TELEGRAM_PROXY_URL=socks5://127.0.0.1:1080

@softfan2019
Copy link
Author

softfan2019 commented Jan 4, 2025

the .env file didn't have any option for proxy url.
So I added this line:
TELEGRAM_PROXY_URL=socks5://myuser:[email protected]:1080

but still got no connection, This is the log:

tail -f /var/log/elora-vpn/elora-vpn.log File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 454, in send conn = self.get_connection(request.url, proxies) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 350, in get_connection proxy_manager = self.proxy_manager_for(proxy) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 215, in proxy_manager_for manager = self.proxy_manager[proxy] = SOCKSProxyManager( File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 61, in SOCKSProxyManager raise InvalidSchema("Missing dependencies for SOCKS support.") requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support. " 2025-01-04 14:53:12,357 (__init__.py:960 Thread-1) ERROR - TeleBot: "Infinity polling exception: Missing dependencies for SOCKS support." 2025-01-04 14:53:12,357 (__init__.py:962 Thread-1) ERROR - TeleBot: "Exception traceback: Traceback (most recent call last): File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/__init__.py", line 955, in infinity_polling self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout, File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/__init__.py", line 1040, in polling logger.info('Starting your bot with username: [@%s]', self.user.username) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/__init__.py", line 273, in user self._user = self.get_me() File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/__init__.py", line 1236, in get_me result = apihelper.get_me(self.token) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/apihelper.py", line 196, in get_me return _make_request(token, method_url) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/telebot/apihelper.py", line 156, in _make_request result = _get_req_session().request( File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 454, in send conn = self.get_connection(request.url, proxies) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 350, in get_connection proxy_manager = self.proxy_manager_for(proxy) File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 215, in proxy_manager_for manager = self.proxy_manager[proxy] = SOCKSProxyManager( File "/opt/elora-vpn/venv/lib/python3.9/site-packages/requests/adapters.py", line 61, in SOCKSProxyManager raise InvalidSchema("Missing dependencies for SOCKS support.") requests.exceptions.InvalidSchema: Missing dependencies for SOCKS support.

It seems to be a problem with venv and socks , I installed pip install pysocks and pip install 'requests[socks]' but it didn't work.

@eloravpn
Copy link
Owner

eloravpn commented Jan 4, 2025

I'll take a look at it and make the necessary adjustments in the next release. In the meantime, you can use the http or https proxy that I have tested.
TELEGRAM_PROXY_URL=http://localhost:10808

@softfan2019
Copy link
Author

@eloravpn Very simple and correct workaround, I don't know Why didn't I think of it. Using http proxy instead of socks5. for now it is working.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants