socks

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

房东的猫 提交于 2019-12-02 21:18:14
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/distributed-scraping-with-multiple-tor-circuits/ class SocksiPyConnection(httplib.HTTPConnection): def _

Using paramiko with socks proxy

痴心易碎 提交于 2019-12-02 21:13:46
问题 I an trying to use paramiko with socks proxy (SecureCRT or putty) configured as socks proxy. I am using the below code and import paramiko,socks host, port = '127.0.0.1', 1080 # Set up your proxy information for this socket sock=socks.socksocket() sock.set_proxy( proxy_type=socks.SOCKS4, addr=host, port=port, ) # Connect the socket sock.connect((host, port)) # Create your Paramiko Transport transport = paramiko.Transport(sock) transport.connect( username='username', #<------not sure if it is

How to disable debug messages on sockjs- STOMP

无人久伴 提交于 2019-12-02 17:25:21
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 fine, the problem is that on the javascript console is full of debug messages like this: <<< MESSAGE

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

不问归期 提交于 2019-12-02 15:10:44
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? HTTP proxy is able to support high level protocols other than HTTP if it supports CONNECT method, which is

Using paramiko with socks proxy

喜夏-厌秋 提交于 2019-12-02 10:56:56
I an trying to use paramiko with socks proxy (SecureCRT or putty) configured as socks proxy. I am using the below code and import paramiko,socks host, port = '127.0.0.1', 1080 # Set up your proxy information for this socket sock=socks.socksocket() sock.set_proxy( proxy_type=socks.SOCKS4, addr=host, port=port, ) # Connect the socket sock.connect((host, port)) # Create your Paramiko Transport transport = paramiko.Transport(sock) transport.connect( username='username', #<------not sure if it is needed, the socks proxy needs no username/password password='secret', ) client = paramiko.client

SOCKS5 connection times out (GCDAsyncSocket). (OpenFire, XEP-0065 and iOS XMPPFramework)

故事扮演 提交于 2019-11-30 16:19:04
Problem : I am attempting a TURNSocket (XEP-0065 - SOCKS5) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, in most scenarios, the receiver returns no response. I currently suspect the problem is to do with the OpenFire proxy server, which times out! This is set up on the local network, and I have edited the hosts file to point to it. Note : The base of my code is from the following tutorial : http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/ XML and Error : The sender sends the following XML

OpenFire/XMPP 503 service-unavailable error (XEP-0065 using iOS XMPPFramework)

ぐ巨炮叔叔 提交于 2019-11-30 15:08:32
Problem : I am attempting a TURN Connection (XEP-0065) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, I am receiving a 503 service-unavailable error. Note : The base of my code is from the following tutorial : http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/ XML Error : I've debugged through TURNSocket.m. It goes into processRequestResponse and has the following XML. (If I am not mistaken, this has been sent from OpenFire to me, rather than vice versa?) ... <iq xmlns="jabber:client" type="error

How to use a SOCKS 5 proxy with cURL?

老子叫甜甜 提交于 2019-11-30 01:13:00
Normal proxies (ex: 72.41.132.22:3128 ) work well with cURL, however when I use SOCKS 5 proxies with username/pass, It just gives me "[1" on the page. Is there a way to use SOCKY 5 proxies with cURL ? $proxy = "cagsan:jw22wdw@108.61.25.223:34792"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_PROXY, $proxy); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, 1); $curl_scraped_page = curl_exec($ch); curl_close($ch); You need to tell cURL the

OpenFire/XMPP 503 service-unavailable error (XEP-0065 using iOS XMPPFramework)

有些话、适合烂在心里 提交于 2019-11-29 21:18:51
问题 Problem : I am attempting a TURN Connection (XEP-0065) using the iOS XMPPFramework and an OpenFire Server. I want to be able to send and receive files. However, I am receiving a 503 service-unavailable error. Note : The base of my code is from the following tutorial : http://mobile.tutsplus.com/tutorials/iphone/building-a-jabber-client-for-ios-server-setup/ XML Error : I've debugged through TURNSocket.m. It goes into processRequestResponse and has the following XML. (If I am not mistaken,

multithreaded crawler while using tor proxy

点点圈 提交于 2019-11-29 15:56:57
I am trying to build multi threaded crawler that uses tor proxies: I am using following to establish tor connection: from stem import Signal from stem.control import Controller controller = Controller.from_port(port=9151) def connectTor(): socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9150) socket.socket = socks.socksocket def renew_tor(): global request_headers request_headers = { "Accept-Language": "en-US,en;q=0.5", "User-Agent": random.choice(BROWSERS), "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Referer": "http://thewebsite2.com", "Connection