socks

Setting Internet Explorer / Windows to use a Socks5 proxy in C#

依然范特西╮ 提交于 2019-12-11 15:34:51
问题 This is driving me nuts. I'm making a SSH Tunnelling application, and need to be able to automatically force the system to use HTTP & Socks5 proxies, and have the changes take effect instantly. HTTP proxies are now taken care of perfectly by the PoshHTTP class , but I can't figure out how to do the same with SOCKS5. I've already tried forcing the changes in the registry, but they don't take effect instantly and it's just not reliable. In most cases I had to open internet options > lan

Python urllib2 with Tor proxy throws `HTTP Error 403`

血红的双手。 提交于 2019-12-11 11:13:31
问题 I am trying to parse a web page using this solution like the following: from bs4 import BeautifulSoup as bs import re import time import random ---------------------- import socks import socket # Can be socks4/5 socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,'127.0.0.1', 9050) socket.socket = socks.socksocket # Magic! def getaddrinfo(*args): return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))] socket.getaddrinfo = getaddrinfo ---------------------- import urllib2 # define

JavaMail: How to use different SOCKS5 for different threads?

流过昼夜 提交于 2019-12-11 07:39:48
问题 I wrote multithreading application which connects to some email accounts from database per thread. I know that JavaMail have no any options to use SOCKS5 for connection so I decided to use it via System.setProperty method. But this method sets SOCKS5 for whole application and I need to use one SOCKS5 per thread. I mean: first thread: uses SOCKS 192.168.0.1:12345 for bob@localhost to connect second thread: uses SOCKS 192.168.0.20:12312 for alice@localhost to connect third thread: uses SOCKS

Dante socks5 does't work from an external server

梦想的初衷 提交于 2019-12-11 07:09:08
问题 I use Dante socks5 proxy for telegram And have a problem with an external server: curl -v -x socks5://user:password@localhost:1080 https://web.telegram.org * Rebuilt URL to: https://web.telegram.org/ * Trying localhost... * TCP_NODELAY set * Connection failed * connect to localhost port 1080 failed: Operation timed out * Failed to connect to localhost port 1080: Operation timed out * Closing connection 0 curl: (7) Failed to connect to localhost port 1080: Operation timed out 回答1: I using this

In RoR, how do I recover from a “Failed to open TCP connection … (general SOCKS server failure)” error?

送分小仙女□ 提交于 2019-12-11 05:55:21
问题 I’m using Rails 4.2.7. Currently Im’ requesting web pages through a SOCKS proxy like so begin ... res1 = Net::HTTP.SOCKSProxy('127.0.0.1', 50001).start(uri.host, uri.port) do |http| puts "launching #{uri}" resp = http.get(uri) status = resp.code content = resp.body content_type = resp['content-type'] content_encoding = resp['content-encoding'] end ... rescue OpenURI::HTTPError => ex ... rescue SocketError, Net::OpenTimeout, Zlib::BufError => e ... end and occasionally I will get the following

How do I catch the “Error during processing: buffer error” in Ruby when getting a web page?

China☆狼群 提交于 2019-12-10 23:45:43
问题 I’m using Rails 4.2.7 and this code to get a webpage through a SOCKS proxy … begin … res1 = Net::HTTP.SOCKSProxy('127.0.0.1', 50001).start(uri.host, uri.port) do |http| puts "launching #{uri}" resp = http.get(uri) status = resp.code content = resp.body content_type = resp['content-type'] content_encoding = resp['content-encoding'] end … rescue OpenURI::HTTPError => ex … rescue SocketError, Net::OpenTimeout => e … Occasionally, I get an error on the line “rest = http.get(uri)” Error during

How to connect to .onion sites using python aiohttp?

泄露秘密 提交于 2019-12-10 23:38:15
问题 I am trying to connect to a .onion site using python. I have tor running on port 9050 and I am getting the following error: Traceback (most recent call last): File "/Users/jane/code/test/test.py", line 15, in main res = await fetch(session, id) File "/Users/jane/code/test/test.py", line 9, in fetch async with session.get(url) as res: File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 1005, in __aenter__ self._resp = await self._coro File "/usr/local/lib/python3.7/site

How to parse a raw HTTP response as HttpListenerResponse?

醉酒当歌 提交于 2019-12-10 13:42:41
问题 If I have a raw HTTP response as a string: HTTP/1.1 200 OK Date: Tue, 11 May 2010 07:28:30 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=UTF-8 Server: gws X-XSS-Protection: 1; mode=block Connection: close <!doctype html><html>...</html> Is there an easy way I can parse it into an HttpListenerResponse object? Or at least some kind .NET object so I don't have to work with raw responses. What I'm doing currently is extracting the header key/value pairs and

Proxying UDP over SOCKS5 proxy in Python

北慕城南 提交于 2019-12-10 04:19:12
问题 Is it possible to send UDP datagrams over SOCKS5 proxy in Python using any SOCKS client lib? SocksiPy does not seem to work or maybe I am just using it wrong. The following code does not work, it tries to connect to the destination directly: s = socks.socksocket ( socket.AF_INET, socket.SOCK_DGRAM ) s.setproxy(socks.PROXY_TYPE_SOCKS5,"socks.proxy.lan") s.sendto ( payload, ( ip, port ) ) If I change SOCK_DGRAM to SOCK_STREAM the code does not work either, it does not try to connect anywhere

cURL request using socks5 proxy fails when using PHP, but it works through the command line

一曲冷凌霜 提交于 2019-12-10 03:49:19
问题 cURL + proxy noob here, having a hard time. I'm having trouble trying to retrieve a web page from a remote secure server via a proxy. Everything has apparently been set up correctly by a remote dev, such that the following command line instruction works and returns what we're looking for: curl -k --socks5-hostname localhost:xxxx https://hostname/ However, the following PHP does not echo the requested webpage. Instead it echoes the error 'Couldn't resolve host name': $proxy = 'localhost:xxxx';