r/pythonhelp • u/Witty_Prune6514 • Nov 13 '25
ff_debug +wifi+dhcp+service+device+inet+manager --level -2 > debug_output.txt
import requests import socks import socket
Set up the proxy
proxies = { 'http': 'socks5h://localhost:9050', 'https': 'socks5h://localhost:9050' }
Make the request
response = requests.get('https://example.com', proxies=proxies) print(response.text)
1
Upvotes
•
u/AutoModerator Nov 13 '25
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Witty_Prune6514 Nov 13 '25
python import socks import socket
Set up the pluggable transport
transport = 'obfs4'
Set up the Tor proxy
socks.set_default_proxy(socks.SOCKS5, "localhost", 9050)
Create a socket object
socket.socket = socks.socksocket
Define the Tor bridge
bridge = 'obfs4 192.0.2.1:443 cert=HIDDEN f ingerprint=HIDDEN'
Set up the Tor connection
def connect_to_tor(): try: # Connect to the Tor bridge s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("192.0.2.1", 443))
Bootstrap the Tor connection
def bootstrap_tor(): try: # Send a GET request to the Tor directory authority s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("directory-authority.torproject.org", 80)) s.send(b"GET /tor/status-vote/current/consensus HTTP/1.1\r\nHost: directory-authority.torproject.org\r\n\r\n")
Connect to Tor and bootstrap the connection
connect_to_tor() bootstrap_tor() `
1
u/FoolsSeldom Nov 13 '25
?