there are two ways to do this both with easy steps to follow do this as i already do.
option 1.
Direct web access to server (not recommended).
for this way you need to have access to your router control panel,
1. first make sure you password protect tvheadend
2. access your router settings and port forward both 9981 and 9982 (default ports for tvheadend) to the pc's ip address.
option 2.
using a ssh tunnel (my preferred way).
1.on your tvheadend system make sure an ssh server is installed (usually on by default) if not install it (ubuntu use command "sudo apt-get install openssh")
2.forward port to the ssh server on your router, the ssh server is on 22 on the machine by default so either forward port 22 or as i do forward a random port higher in the number list to port 22 on your tvheadend.
3. on your connecting computer using ssh software login to your ssh using port forwards.
* On Linux in command line use ssh -L 9981 localhost:9981 -L 9982 localhost:9982 [username]@[ipaddress of home]
* On Windows i recommend either putty or bitvise ssh client
* On Android I reccomend ConnectBot
* I cannot advise on IOS or MAC but if there is a ssh client software with port forwarding then youll be able to setup.
for either option your ip address needs to be remembered (if setup to be static by your provider) or sign up to a service that gives you a web address to use instead like
http://dyn.com/dns/ (there may be free alternatives out there)