proxy

Urllib2 using Tor and socks in python

早过忘川 提交于 2020-01-25 18:00:14
问题 I'm trying to crawl websites in Python using tor. I tried below code, which gives the IP used by tor, trying this code for 2-3 times gives me different IP's from different countries. I want IP's from specific country eg India . Can we do it using tor and socks? import socks import socket import urllib2 socks.setdefaultproxy(socks.PROXY_TYPE_HTTP, "127.0.0.1", 9050) socket.socket = socks.socksocket print urllib2.urlopen('http://my-ip.herokuapp.com').read() 回答1: To get ip from specific country

C# Proxy with username and password

浪尽此生 提交于 2020-01-25 16:30:23
问题 I set up a proxy instance and used it with a webrequest object. WebProxy a = new WebProxy("ip:port", true); proxy.Credentials = new NetworkCredential("username", "password"); WebRequest b = WebRequest.Create("webpage url"); b.Proxy = proxy; WebResponse c = req.GetResponse(); StreamReader d = new StreamReader(c.GetResponseStream()); d.ReadToEnd();//web page source Works as it should, but I want to display the page in a web browser control without loss of information and design. If I set my

Web Service Client - Construction Failing Due To Timeout (Proxy Issue)

纵饮孤独 提交于 2020-01-25 11:43:05
问题 I have a webservice in Java 1.6 that extends javax.xml.ws.Service . The WSDL URL is located at an HTTPS endpoint and I am behind a corporate proxy (NTLM I believe). I have the proxy host, port, username, and password. I have verified that I can access the WSDL using curl if I specify the proxy in my .curlrc file. When the constructor is called it will eventually timeout with the error: javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.blah.com/myservice.asmx?wsdl. It

Node.js/pm2 - Can't kill TCP connection

删除回忆录丶 提交于 2020-01-25 10:12:27
问题 I'm trying to use NordVPN like a standard web proxy by adding the proxy to the request options like so: const request = require('request-promise'); const options = { url: 'https://icanhazip.com', proxy: 'tcp://email@email.com:pass@us349.nordvpn.com', } const res = await request.get(options); // returns the NordVPN server ip address This works, however, NordVPN allows a maximum of 6 connections and when the proxy url is changed, the previous connection stays open. I see that I can run sudo

Node.js/pm2 - Can't kill TCP connection

谁说胖子不能爱 提交于 2020-01-25 10:12:06
问题 I'm trying to use NordVPN like a standard web proxy by adding the proxy to the request options like so: const request = require('request-promise'); const options = { url: 'https://icanhazip.com', proxy: 'tcp://email@email.com:pass@us349.nordvpn.com', } const res = await request.get(options); // returns the NordVPN server ip address This works, however, NordVPN allows a maximum of 6 connections and when the proxy url is changed, the previous connection stays open. I see that I can run sudo

Why is Scrapy skipping some URL's but not others?

无人久伴 提交于 2020-01-25 08:05:31
问题 I am writing a scrapy crawler to grab info on shirts from Amazon. The crawler starts on an amazon page for some search, "funny shirts" for example, and collects all the result item containers. It then parses through each result item collecting data on the shirts. I use ScraperAPI and Scrapy-user-agents to dodge amazon. The code for my spider is: class AmazonSpiderSpider(scrapy.Spider): name = 'amazon_spider' page_number = 2 keyword_file = open("keywords.txt", "r+") all_key_words = keyword

Will I be able to tell a Hosted Internet Explorer Web Browser control to always bypass the proxy settings?

别说谁变了你拦得住时间么 提交于 2020-01-25 06:44:15
问题 Following scenario: Having a hosted IE web browser control and an in-app web server (like this one). The web server runs at (e.g.) http://127.0.0.1:14284 and the web browser calls this URL. Now we have a customer which has a proxy server configured in IE options, and also checked "bypass proxy on local addresses". Unfortunately, the hosted IE web browser control still used the proxy settings, even for the local URL http://127.0.0.1:14284. My question is: Am I somehow able to tell my hosted

Proxy built with netcat not allowing http basic authentication

◇◆丶佛笑我妖孽 提交于 2020-01-25 06:38:16
问题 I made a simple proxy server using nc , here's the one-liner: mkfifo queueueue nc -l 8080 <queueueue | nc http://$JENKINS_HOSTNAME 80 >queueueue It listens on port 8080 and then forwards the data to a connection to our Jenkins server. Jenkins is behind a VPN, and the machine I am running this proxy on has VPN access. On my other machine (no VPN access), I would like to curl the Jenkins server, here's the command to initiate the request through the proxy: http_proxy=10.1.10.10:8080 curl --user

nginx as load balancer server out 404 page based on HTTP response from app server

无人久伴 提交于 2020-01-25 04:55:11
问题 I'm using Nginx as a load balancer with app servers behind it. If the app servers return a response of 404 not found, I would like nginx to then server out a 404 page that is local on that server. I would like to do this so my app servers don't get tied up serving a static HTML file and can instead just quickly return a response and let nginx handle serving the static stuff. Does anyone know how I can accomplish this? Basically I need some kind of conditional check based on the HTTP response.

Transform a Javascript object into a proxy (and not its reference)

不问归期 提交于 2020-01-24 20:25:06
问题 I can take a Javascript object o and create a new Proxy object from it: let p = new Proxy(object, { ... }) But is there a way to mutate an existing object reference to track changes on the original object? In particular, is there a way I can track the addition of new keys on the object from exterior sources? 回答1: The Proxy spec supports defining a proxy on the prototype of an object as a means for inspecting actions on that object when they do not exist on the instance. While this isn't full