Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Watch EyeTV shows over the net on another port Internet
Having a MacBook Pro while on the go and a good cable modem connection with an always-on Mac Mini connected to it, I wanted to be able to watch my EyeTV recordings when I am not at home. Elgato has released EyeTV 2.5 which includes the ability to make recordings "wi-fi accessible." This means that they've implemented sort of a media server which -- after enabling it once in the EyeTV preferences -- even runs when EyeTV is closed. This built-in media server runs on port 2170, which:
  1. I did not want to expose to the internet, so I had to find a way around this.
  2. Would be useless, as my employer won't let me out of the intranet on other than on port 80 or 443
Having Apache running with the default installation on Mac OS X, I first tried mod_proxy, but this didn't work out. That's because the EyeTV media server sends the Content-Type for HTML pages not in the server's response header, but in a META tag in the HTML itself. When the content-type isn't specified, mod_proxy sets it to text/plain, which is definitely not what I wanted.

So I've installed the Apache::ReverseProxy module from CPAN, and hacked on it a little bit in order to make it fit my needs. I've replaced the part where it sets the content-type header in the answer from the proxy back to the client with a check on undefined or empty content-type, and setting the default content-type to 'text/html'. Below are my changes to the file (+ = added, - = deleted from source):
-        $r->content_type($response->header('Content-type'));
+        my $content_type = $response->header('Content-type');
+        if (! defined $content_type || length($content_type) == 0) {
+            $content_type = 'text/html';
+        }
+        $r->content_type($content_type);
With these changes, I could add a virtual host configuration for my new "TV" URL:
-- VirtualHost *:80
  -- Location /
    SetHandler              perl-script
    PerlHandler             Apache::ReverseProxy
    PerlSetVar              ReverseProxyConfig /etc/httpd/rproxy.conf
  -- /Location
  RedirectMatch           ^/$     /eyetv
-- /VirtualHost
Finally, I added a file named rproxy.conf in /etc/httpd with the following content:
/ http://machine.with.eyetv.server:2170/
Of course, if you haven't already done so, you have to enable mod_perl in /etc/httpd/httpd.conf by uncommenting the corresponding AddModule and LoadModule directives. Now restart Apache and there you go! Note: Funnily enough, this does not work with Safari, but only with Firefox. [Elgato: please fix the HTML generated by the EyeTV media server!]

[robg adds: I haven't tested this one, and it assumes a certain level of knowledge about CPAN and working with httpd configuration files.]
  • Currently 2.00 / 5
  You rated: 3 / 5 (8 votes cast)

Watch EyeTV shows over the net on another port | 6 comments | Create New Account
Click here to return to the 'Watch EyeTV shows over the net on another port' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Watch EyeTV shows over the net on another port
Authored by: argh128 on Oct 09, '07 07:44:49AM

If your mac mini is behind a router (which it probably is) why not just have your router forward external port 80 to mac mini port 2170?


A completely SANE Canadian.

[ Reply to This | # ]
Watch EyeTV shows over the net on another port
Authored by: elfinabout on Oct 09, '07 08:22:17AM

Because although he could send commands IN (and he probably did have to set a forward rule for this), the output would still be sent OUT via the default port, and hence not viewable at work on 80/443.

[ Reply to This | # ]
Watch EyeTV shows over the net on another port
Authored by: plambert on Oct 09, '07 09:02:09AM

I think the original commenter is suggesting that the gateway be configured to do two-way NAT of incoming traffic on port 80 to the Mac mini's high port, and not to just stupidly replace the destination ip and port in the incoming packets.

In fact, I don't even know if I could figure out how to do it the wrong way you describe on most gateways.

Any gateway that supports NAT for public services on the private LAN--which is probably most of them--would do the trick nicely.

[ Reply to This | # ]
Watch EyeTV shows over the net on another port
Authored by: makuck on Oct 09, '07 09:11:36AM

FYI- regarding point (a) of not wanting to expose 2170/tcp... You are actually much safer exposing that port than a common port like 80/tcp. Bots search for (and pound on) hosts who listen on port 80, since there are a lot of web-based (php, cgi, etc.) exploits to be had. Listening on uncommon ports is a better security practice.

Obviously, your point (b) overrides this, but I thought it was worth mentioning nonetheless.

[ Reply to This | # ]
Watch EyeTV shows over the net on another port
Authored by: ejensen on Oct 09, '07 09:54:08AM

Perhaps I am missing the point but I have been using CyTV+VLC for years to watch EyeTV recordings and live TV without the hassles involved here. I have not tried any port trickery with it though- you can download its source code though. I tried out the new (v2.5) EyeTV server but was pretty underwhelmed so I turned it off again. The EyeTV server requires all of the recordings to be in H.264, which is a significant system load as the files are re-encoded. CyTV plays standard recorded files just fine over my 802.11g WLAN at home. I did (just to see) temporarily open the CyTV ports on my router and could get things from work too but the upload speeds on my cable modem made it less than nice viewing, and I turned it off [confession- I did once sftp a BSG season 2.5 new episode when I was on the road in Germany].

[ Reply to This | # ]
Watch EyeTV shows over the net on another port
Authored by: ejensen on Oct 10, '07 06:45:46PM
To just follow up, I think the CyTV server can do what you want more easily (though I didn't try setting it up myself). Also it looks like if it cannot, this old hint on re-streaming CyTV through VLC would do it: <>;.

[ Reply to This | # ]