首页 > 编程知识 正文

android socks5 proxyandroid SOCKS proxy

时间:2023-05-06 13:17:49 阅读:208788 作者:1921

I have the following code in my (test) android project:

Proxy proxy = new Proxy(Proxy.Type.SOCKS, sa);

HttpURLConnection conn = (HttpURLConnection) u.openConnection(proxy);

Then I have implemented a SOCKS server listening on port 1080.

The problem I have is that in the SOCKS4 connection request, the destination address and port is not "ip for google":80 but rather 127.0.0.1:1080, i.e. the proxy address.

If I return ok, I start getting HTTP data.

Am I doing something wrong or is there a bug in the SOCKS-client?

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。