Saturday, December 12, 2009

IProxy , Proxy Server for Symbian

When I made my first Firefox plug-in to free browsing . I thought it will be good to port this method to mobile devices. I took python started testing . while I was wrestling with python one guy (dInGd0nG , Thanks a lot man) from gstek send me a message regarding a similar trick for reliance. So I decided to make my app to include that also. Then I finalized that it will be nice to make a proxy server with modules support to run in different network. I already had a proxy server developed before to do some magic with airtel live, but it was crap and I had to rewrite almost codes to make his catch everything. The main issue was the limited resource, I had a my Nokia 6630 to test , during testing it started to complain about low memory now and then . The memory issue was mainly due to User Interface with a canvas and some pooling threads. So I cut the UI to a simple text , still the memory issue persist. Then I decided to run the proxy as a background daemon ( using e32.start_server ). This eliminated low memory issue. But I know this won't be a good idea to run server in s60 3rd Ed devices because the python launcher in Python package has zero capability , this won't be good for our proxy server since it uses socket connection as well as some file operations to read and write settings . This forced me to repack python for 3rd Ed to repack with all 17 capabilities, and sign it. Since I didn't have access to 3rd Ed device I couldn't test it and I left it. Then I wrote module to redirect requests to indiatimes gateway . everything went fine and to my surprise I found the proxy works well on Opera Mini 4.2 ( + Ucweb) as well :) .
The package includes reliance module too, since I didn't have a reliance connection I couldn't test it. The app includes 'BlueLog' to redirect the messages from proxy daemon to a PC Bluetooth COM port for debugging.



Installation Procedure

First create a new Wap profile
for advanced users : iproxy listens on port 8085 ( default) at local host , create a new Access point with valid access point and proxy as 127.0.0.1 and port 8085
others:
Open menu >> tools>> settings>>connection>>Access points








options>> New access point >> Use default settings



change connection name to "iProxy"


Data bearer to 'Packet Data'
Access point to your valid access point in my case its 'airtelfun.com' since I am on airtel . I think its rcomwap for reliance


Leave username, Prompt password, password, Authentication
change homepage to 'http://www.google.com'




Then options>>Advanced Settings


Change Proxy Serv address to 127.0.0.1





change Proxy port number to 8085



now press back and exit from settings
Note : The procedure may be little different for newer phones please DONT ask customer care people to send you the settings

Installing
2nd Ed. Phones

Download and install python from Source Forge
Download and install iProxy from here

3rd Ed. Phones

Note iProxy is developed under pys60 1.4.5 and NOT new the new 1.9.7 because there is no new python for second Ed. phones ;(. If you have already installed it please uninstall it
Original python package has to be modified to add capabilities to python launcher.exe.

Since I am not rich to buy a symbian signing certificate to run this app you have two options
1) you can sign my application with your phone dependent dev cert. for more details please visit how to get a dev cert here
OR
2) Hack your phone so that you can install untrusted apps. If you already hacked your phone with Binpda secman or Helloworldx2 proceed to the step 4 .You can do this either by this or this

3) if you hacked in some other method then sign application as they say. If you used secman or Helloworldxed your phone no need to sign the app its already signed for your phone

4) Download and install python package from here ( package at sourceforge or at nokia forum wont be able to run iProxy)

5) download and install iProxy from here



configuring

Open iProxy from your menu


Press options menu >> Settings >> General Then press 'Ok'


Press options menu >> Change Module. And select your modules . Installation pack contains to two modules named 'indiatimes' ( for Airtel users) and 'reliance' ( for Reliance users , not yet tested by me )



Press options menu >> Change Access point and select your Access point as the one we created before 'iProxy'



press exit to return to main console
Press options menu >> Settings >> indiatimes Then press 'Ok' (Airtel only)


Verify the proxy address of your original proxy and port as provided by operator


press exit
options >> Start Proxy

wait for console to print 'proxy started' or if you get ' error in starting proxy check settings' please recheck everything. or Restart your phone and try again
now you can exit iproxy remember server is running background


Now open your phone browser

options>>settings>> default access point


change it to 'iProxy'


press back to main widow of browser click on iProxy ,


there you go now start browsing


For opera mini choose 'iproxy' as access point when ask, you may have to run the connection test for first time or manually you can choose connection mode as 'HTTP'

A word about BlueLog

You can find a BlueLog menu in general settings. Its for capturing real time messages from proxy server to PC for diagnostics. For general use no need to enable BlueLog. To enable BlueLog switch on bluetooth on mobile as well as pc, from the blue log menu press 'select device' and choose your pc. iProxy will search for available serial ports and list ( if no serial port find add manually refer your bluetooth driver spec ). select serial port and enable BlueLog. Setup your pc with HyperTerminal or Putty ( Whatever) to listen on the specific bluetooth port and start proxy
If you dont have any idea about this don't worry it doest affect iProxy . Make sure you disable the Bluelog ( iProxy wont start if Bluelog enabled and configured wrongly)

Please note The App is not yet fully tested if u find some bug feel free to contact me i will help as far as i can

Developer note :
Proxy also supprorts custom commands as well as modules. The package includes two modules and one command ( about command enter http://ip*about/ in browser ) . Developed SDK documentation is not yet written if someone intrested i may be able to help to develop your own custom modules and commands.

Note : s60 v3 version and reliance modules are not tested by me.


4 comments: