2

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

Petrakous
  • 58
  • 1
  • 7

0 Answers0