balderdashy/sails.io.js — pull request #25 by RWOverdijk (2014-09-11 06:47:12+00:00)
Title: isXOrigin

Simple. The hostname is _just_ the hostname. No ports, no protocol.. So no matter what is in io.sails.url, it must contain location.hostname.

```javascript
location.hostname;
// > "api.islive.io"

'islive.io'.search(location.hostname) === -1;
// > true

'api.islive.io'.search(location.hostname) === -1;
// > false

'http://api.islive.io/namespace'.search(location.hostname) === -1;
// > false
```