- How do I run Meteor on port 80?
- What cross-site scripting restrictions affect Meteor?
- Is caching a problem, and how do you solve it?
- Can you stream through a proxy server?
- I have a shared/free hosting account. Can I run Meteor?
- What can you use Meteor for?
How do I run Meteor on port 80?
To get around cross site scripting restrictions (see What cross-site scripting restrictions affect Meteor?) you'll need to serve Meteor from the same port as your web server. Clearly they can't both bind to the same port on the same IP so you either need to run them on separate machines, or have multiple IPs available to your server. You will probably want to use port 80, since that's the default port used by web browsers, but ports under 1024 are reserved for processes running as root.
So the problem we're addressing here is how to run Meteor on port 80 despite the restriction on running processes on low port numbers. There are two practical solutions: run Meteor as root, or configure your firewall to internally redirect traffic on port 80 of your second IP address to port X, where X is greater than 1024 and is the port on which Meteor is listening.
What cross-site scripting restrictions affect Meteor?
There are three important cross-site scripting restrictions that you should be aware of:
- Frames requested from different subdomains of the same parent will not talk to one another until
document.domainis set to a domain that both frames share. - Gecko-based browsers will not allow
document.domainto be lengthened once it has been shortened. - In Internet Explorer, you can only make XMLHTTPRequests to the host from which the page in which the XMLHTTPRequest object is used was requested.
For a detailed examination of cross site scripting and the same origin policy, see the cross site scripting matrix.
Is caching a problem, and how do you solve it?
Yes, in some cases local caching is an issue, particularly with polling requests. Meteor solves this by appending a millisecond timestamp to the end of each request, making each querystring slightly different. The timestamp parameter is ignored by Meteor server. Meteor also adds no-cache headers to all responses and includes no-cache meta tags (for luck).
Can you stream through a proxy server?
Ish. If there is a proxy server between the client and Meteor, strange things may happen. At worst the client may never receive the stream at all. Some proxies will allow streaming but will have a timeout on the maximum duration of a connection, so the stream will occasionally have to reconnect. Others have no problems at all. If the proxy does not allow streaming the client will give up and use polling mode after the pingtimeout has expired.
I have a shared/free hosting account. Can I run Meteor?
Almost certainly not. Running Meteor requires a fair amount of filesystem surgery, as well as reconfiguration of Apache, added to which you need two IP addresses at your disposal. There may be some ISPs that give you this much freedom within a virtual server account, but we don't know of any.
What can you use Meteor for?
We use it for live chat applications and datalogging, but there are loads of potential uses:
- Combine it with a bit of clever javascript on the front end and you can draw real-time graphs.
- Update stock price tables in real time
- Live update of comments on your blog/forum
- Display real time telemetry from anything from a remote controlled buggy to supermarket checkouts
- Real time web analytics (such as the starscape at the top of every page on this site)