Skip to content

Instantly share code, notes, and snippets.

@ValeryVerkhoturov
Last active March 12, 2025 19:39
Show Gist options
  • Save ValeryVerkhoturov/4849b2764020da8bc2095fa659c6864a to your computer and use it in GitHub Desktop.
Save ValeryVerkhoturov/4849b2764020da8bc2095fa659c6864a to your computer and use it in GitHub Desktop.
Update bridges to make tor service work on MacOS

Install tor via HomeBrew and start the tor service.

brew install tor && brew services start tor

And to use obsf4 proxy we need to install its library/ Use HomeBrew for installation of the library.

brew install obfs4proxy

https://formulae.brew.sh/formula/obfs4proxy

Get the obsf4 bridges from https://bridges.torproject.org/options or send email to [email protected] with body get transport obfs4.

Create if not exists and edit the torrc file ($(brew --prefix)/etc/tor/torrc), add the following

# Using Bridges, obsf4
UseBridges 1
ClientTransportPlugin obfs4 exec /opt/homebrew/bin/obfs4proxy managed

# send email to [email protected] with body `get transport obfs4` you can get new bridges.
# Or use https://bridges.torproject.org/options
# Paste the obsf4 bridges here and put Bridge in front of each.
Bridge obfs4 78.194.206.56.. B80190D0C0771298F04AE56L..... cert=61xl3nF07Ssg... iat-mode=0
Bridge obfs4 185.220.101.17.. 59F4CBDE79D51FEC12AC1F4304D006C97D4.. cert=p9L6... iat-mode=0
Bridge obfs4 185.220.101.17.. 59F4CBDE79D51FEC12AC1F4304D006C97D4.. cert=p9L6... iat-mode=2

Now restart the TOR service using

brew services restart tor

Check Ip addresses are different with and without proxy.

ip_no_proxy=$(curl -s https://api.ipify.org)
ip_with_proxy=$(curl -s --proxy socks5h://127.0.0.1:9050 https://api.ipify.org)
if [ "$ip_no_proxy" != "$ip_with_proxy" ]; then
    echo "IP address is different with and without proxy."
    echo "IP without proxy: $ip_no_proxy"
    echo "IP with proxy: $ip_with_proxy"
else
    echo "IP address is the same with and without proxy."
    echo "IP: $ip_no_proxy"
fi

To change the circuit run

brew services reload tor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment