user959129
user959129

Reputation:

How to use a proxy in python and twisted to get a page

Is it true that if you have a proxy such as http://222.126.99.99:8909 that you can access a url from the browser e.g. www.cnn.com as http://222.126.99.99:8909/www.cnn.com.

Is this is true, from twisted can I use the proxy to get a page as follows?

iUrl=http://222.126.99.99:8909/www.cnn.com
client.getPage(iUrl,method='GET').addCallback(self.processPage,iUrl).addErrback(self.printError,iUrl)

Upvotes: 0

Views: 321

Answers (1)

jfs
jfs

Reputation: 414885

if the proxy requires a username and password..how do I do modify the URL to use the credentials?

The format is:

url = 'http://username:password@host:port/path'

Though it is deprecated.

Note, it is not safe to send your username and password over http.

Upvotes: 1

Related Questions