socks

Proxy not working over SSL connection

北城余情 提交于 2019-12-04 06:23:51
问题 I'm trying to use tor, socksipy and ssl to proxy a ssl connection. My client looks like this: import socks, ssl s = socks.socksocket() s.setproxy(socks.PROXY_TYPE_SOCKS5,"127.0.0.1", 9050) ssl_sock = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1) ssl_sock.connect(('127.0.0.1', 443)) The server just accepts connections and prints getpeername . The peer name is always 127.0.0.1. It doesn't even matter if I give it a non-valid proxy. The client won't complain, it will connect anyway. How do

how to use Socks4/5 Proxy Handlers in Netty Client (4.1)

纵饮孤独 提交于 2019-12-04 02:28:45
I need to configure socks proxy in Netty client (to request different sites via socks4 or 5 proxies). Tried a lot of proxies from free socks lists (like www.socks-proxy.net, http://sockslist.net/ etc) but with no luck: @Test public void testProxy() throws Exception { final String ua = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"; final String host = "www.main.de"; final int port = 80; Bootstrap b = new Bootstrap(); b.group(new NioEventLoopGroup()) .channel(NioSocketChannel.class) .handler(new ChannelInitializer<SocketChannel>() {

Socks 5 client in C

本小妞迷上赌 提交于 2019-12-03 23:23:17
问题 I'd like to write socks 5 client using stream sockets in C. Here is my code: /* ** client_socks.c -- a stream socket socks 5 client demo */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket.h> #include <arpa/inet.h> #define PORT "9050" // the port client will be connecting to #define MAXDATASIZE 100 // max number of bytes we can get at once // get sockaddr,

How to scrape a website with the socksify gem (proxy)

不想你离开。 提交于 2019-12-03 22:11:43
I am reading through the documentation of the socksify gem on Rubyforge. I have installed the gem successfully, and I have run this documented code with success to test that my local implementation can replicate it: require 'socksify/http' uri = URI.parse('http://rubyforge.org/') Net::HTTP.SOCKSProxy('127.0.0.1', 9050).start(uri.host, uri.port) do |http| http.get(uri.path) end # => #<Net::HTTPOK 200 OK readbody=true> But how do I e.g. scrape 'http://google.com/' , and get the html content? I wish to parse it with e.g. Nokogiri like this: Nokogiri::HTML(open("http://google.com/)) require

java runtime 6 with socks v5 proxy - Possible?

冷暖自知 提交于 2019-12-03 13:10:59
I have written an application that (amongst other things) runs a local service in windows that acts as a SOCKS v5 proxy for Firefox. I'm in the debugging phase right now and have found certain websites that don't work correctly. For example the Java Applet for Picture Uploading on Facebook.com fails because is is unable to lookup domains. My app overrides a hidden FF config setting network.proxy.socks__remote__dns setting it to true . The whole purpose of the app is to allow access to websites when behind a firewall (e.g. if the user is in China), so this setting is essential to ensure domains

Why Tor cant access localhost pages

99封情书 提交于 2019-12-03 11:45:45
I have Tor running and a python script to get web pages: socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) socket.socket = socks.socksocket print urllib2.urlopen(URL).read() However, if the URL is http://localhost/some_page.html I get the following error: raise Socks5Error(ord(resp[1]),_generalerrors[ord(resp[1])]) TypeError: __init__() takes exactly 2 arguments (3 given) Can someone explain to me what exactly happens? Thank you. It is the way protocol is designed. When you send a request, it is transported to another machine on Internet with Socks5 envelope. So actual request

How to write a DownloadHandler for scrapy that makes requests through socksipy?

◇◆丶佛笑我妖孽 提交于 2019-12-03 07:52:20
问题 I'm trying to use scrapy over Tor. I've been trying to get my head around how to write a DownloadHandler for scrapy that uses socksipy connections. Scrapy's HTTP11DownloadHandler is here: https://github.com/scrapy/scrapy/blob/master/scrapy/core/downloader/handlers/http11.py Here is an example for creating a custom download handler: https://github.com/scrapinghub/scrapyjs/blob/master/scrapyjs/dhandler.py Here's the code for creating a SocksiPyConnection class: http://blog.databigbang.com

How to disable debug messages on sockjs- STOMP

大憨熊 提交于 2019-12-03 04:04:42
问题 I have the follow situation: var options = { protocols_whitelist : [ "websocket", "xhr-streaming", "xdr-streaming", "xhr-polling", "xdr-polling", "iframe-htmlfile", "iframe-eventsource", "iframe-xhr-polling" ], debug : false }; var socket = new SockJS("/mmyurl/",undefined,options); var stompClient = Stomp.over(socket); stompClient.connect({ company : "XXXXX" }, function(frame) { stompClient.subscribe('/topic/mytopic', function(message){ var myitem = JSON.parse(message.body); }); all works

Why does SOCKS5 require to relay UDP over UDP?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 03:20:15
The SOCKS5 protocol, described by RFC1928 provides support for UDP. To summarize, a client wishing to relay UDP packets through a SOCKS5 server must, at least: open a TCP connection to the SOCKS5 server; send a UDP ASSOCIATE request (cf section 4 ); receive from the server the address and port where it must send UDP packets to be relayed; send datagrams (UDP) to that address, encapsulated with some headers (cf section 7 ). Here are some relevant quotations, from section 6 : A UDP association terminates when the TCP connection that the UDP ASSOCIATE request arrived on terminates. In the reply

Why are HTTP proxies able to support protocols like IRC and FTP?

99封情书 提交于 2019-12-03 01:43:31
问题 I understand that a SOCKS proxy only establishes a connection at the TCP level while an HTTP proxy interprets traffic at HTTP level. Thus a SOCKS proxy can work for any kind of protocol while an HTTP Proxy can only handle HTTP traffic. But why does an HTTP Proxy like Squid can support protocol like IRC, FTP ? When we use an HTTP Proxy for an IRC or FTP connection, what does specifically happen? Is there any metadata added to the package when it is sent to the proxy over the HTTP protocol? 回答1