1 year ago

#346200

test-img

Petrakous

How to use sockets (or socks) with a proxy and send data from that proxy to a website?

So as mentioned in the title I want to be able to send data to an ip anonymously through a proxy using the sockets module.. or the socks module.. (i know that this can be done with different modules but i want this specific one because i can better understand it)

i have used the socks module as shown below.. but i always get an error saying "No connection could be made because the target machine actively refused it".. i have tried a number of different proxies an got no luck.. so im thinking that im doing something wrong here.. any ideas?

import socks

Socket=socks.socksocket()

Socket.setproxy(socks.PROXY_TYPE_SOCKS4,"(ProxyIP)",(ProxyPort))
Socket.connect(("(WebsiteIP or Domain Name)",(WebsitePort)))
Socket.close()
print ("connected")

Also i have tried this but got the same error
Python socket module. Connecting to an HTTP proxy then performing a GET request on an external resource

python

python-3.x

sockets

proxy

socks

0 Answers

Your Answer

Accepted video resources