I
I
Ilkhomjon Matazimov2020-08-14 18:13:39
Python
Ilkhomjon Matazimov, 2020-08-14 18:13:39

Why doesn't socks5 proxy hide my real IP?

I bought an IPv4 proxy, and my IP still fires:

import requests
r = requests.get("https://ramziv.com/ip", proxies=dict(
    http='socks5://адрес:порт@логин:пароль'
)).text
print(r)


Gives IP not a proxy, but my real

result:
Is it supposed to be like that? Or did I do something wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilhomjon Matazimov, 2020-08-14
@mr_qpdb

I managed to solve it with this code:

import socket
import socks
import requests

socks.set_default_proxy(socks.SOCKS5, addr='адрес', port=1234,
                        username='котак', password='котакбас')
socket.socket = socks.socksocket

r = requests.get("https://ramziv.com/ip").text
print(r)

L
Lesha, 2020-08-14
@hydrugz

Maybe you don't have PySocks installed?
pip install -U requests[socks]

import requests
proxies = {'http': "socks5://server:port"}
r = requests.get('https://ramziv.com/ip', proxies=proxies).text
print(r)

https://stackoverflow.com/questions/12601316/how-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question