Tutorials Linux Emulator Networking Proxy Firewall

= Howto proxy network connections in Emulator =

Since the emulator is running as x86, you can just copy over your tsocks files from your linux distro
scp -P 5522 /usr/bin/tsocks root@localhost:/usr/local/bin scp -P 5522 /usr/lib/libtsocks.so root@localhost:/usr/lib
 * Fire up the emulator (palm-emulator)
 * copy tsocks to Emulator -> /usr/local/bin
 * copy libtsocks.so to Emulator -> /usr/lib

Create the tsocks.conf file

 * 1) This is the configuration for libtsocks (transparent socks)
 * 2) Lines beginning with # and blank lines are ignored
 * 3) The basic idea is to specify:
 * 4) 	- Local subnets - Networks that can be accessed directly without
 * 5) 			 assistance from a socks server
 * 6) 	- Paths - Paths are basically lists of networks and a socks server
 * 7) 		 which can be used to reach these networks
 * 8) 	- Default server - A socks server which should be used to access
 * 9) 			  networks for which no path is available
 * 10) Much more documentation than provided in these comments can be found in
 * 11) the man pages, tsocks(8) and tsocks.conf(8)
 * 1) the man pages, tsocks(8) and tsocks.conf(8)


 * 1) Local networks
 * 2) For this example this machine can directly access 192.168.0.0/255.255.255.0
 * 3) (192.168.0.*) and 10.0.0.0/255.0.0.0 (10.*)

local = 192.168.0.0/255.255.255.0 local = 10.0.0.0/255.0.0.0
 * 1) local = /


 * 1) Paths
 * 2) For this example this machine needs to access 150.0.0.0/255.255.0.0 as
 * 3) well as port 80 on the network 150.1.0.0/255.255.0.0 through
 * 4) the socks 5 server at 10.1.7.25 (if this machines hostname was
 * 5) "socks.hello.com" we could also specify that, unless --disable-hostnames
 * 6) was specified to ./configure).


 * 1) path {
 * 2) 	reaches = 150.0.0.0/255.255.0.0
 * 3) 	reaches = 150.1.0.0:80/255.255.0.0
 * 4) 	server = 10.1.7.25
 * 5) 	server_type = 5
 * 6) 	default_user = delius
 * 7) 	default_pass = hello
 * }


 * 1) Default server
 * 2) For connections that aren't to the local subnets or to 150.0.0.0/255.255.0.0
 * 3) the server at 192.168.0.1 should be used (again, hostnames could be used
 * 4) too, see note above)

server =  server_type = 5 server_port = 1080
 * 1) server = 192.168.0.1
 * 1) Server type defaults to 4 so we need to specify it as 5 for this one
 * 1) The port defaults to 1080 but I've stated it here for clarity

default_user = user@host default_pass =

/usr/local/bin/tsocks wget http://www.cnn.com
 * You can test your config file by doing this
 * If you are behind the socks proxy and the tsocks.conf is setup correctly, then the wget command should work.

Permanently shim LunaSysMgr
exec /usr/local/bin/tsocks /usr/bin/LunaSysMgr -s `cat /var/luna/preferences/sysmgr-args`
 * You can force LunaSysMgr to always use the proxy by editing the upstart script that lives in /etc/event.d
 * Add the tsocks line in front of the call to exec LunaSysMgr
 * vi /etc/event.d/LunaSysMgr and update the exec line to make it look like this:
 * reboot the emulator.  enjoy.