How to use urllib with proxy in PyS60

by Marcelo Barros

Nowadays proxy support has become an requisite for practically all applications that connect to the Internet. In general, they are used in intranets due to reasons like security, access control and bandwidth saving. If you are developing networked applications using urllib and Python for S60, it is interesting to add proxy support for it, generating a larger number of potential users.

For instance, if you are behind a proxy, the following code will fail:

urllib.urlretrieve("http://wiki.forum.nokia.com/","wikiforumnokia.html")

With few modifications, it is possible to download the desired URL, just adding proxy support:

proxy = "http://username:password@proxy_ip:proxy_port"
urlprx = UrllibProxy(proxy)
urlprx.urlretrieve("http://wiki.forum.nokia.com/","wikiforumnokia.html")

Interested ? Please, take a look in the article “How to use urllib with proxy in PyS60“.

Related posts:

  1. Network programming for PyS60 (X) To celebrate our tenth post, I will talk about urllib...
  2. Connecting to Pandorabots from Flash Lite Yesterday, I authored an article at Forum Nokia, as to...
  3. Network programming for PyS60 (XIV) Have you already heard about Beautiful Soup ? Beautiful Soup...
  4. Pys60 on Linux Just in -> Pys60 on Linux Are you a...
  5. Network programming for PyS60 (XVI) Qik is a new and innovative service that allows you...

Related posts brought to you by Yet Another Related Posts Plugin.