Comparing version 0.4.0 to 0.4.1
# Change Log | ||
## 0.4.1 | ||
### Added | ||
* WebSocket support for projects being accessed using local `.dev` domain. | ||
## 0.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -1,6 +0,6 @@ | ||
## Dev domain support | ||
# Configuring local .dev domains | ||
This step is totally optional and you can use `hotel` without it. | ||
This step is totally optional and you can use hotel without it. | ||
To use local `.dev` domain, you need to configure your browser or network to use `hotel`'s proxy auto-config file which is available at `http://localhost:2000/proxy.pac` (view [proxy.pac](../src/daemon/proxy-pac.js) content). | ||
To use local `.dev` domain, you need to configure your browser or network to use hotel's proxy auto-config file which is available at `http://localhost:2000/proxy.pac` [[view file content](../src/daemon/views/proxy-pac.js)]. | ||
@@ -12,12 +12,34 @@ After that, you'll be able to access servers using `.dev` domains: | ||
### Browser configuration | ||
## System configuration (recommanded) | ||
* __Firefox__ `Preferences > Advanced > Network > Connection > Settings > Automatic proxy URL configuration` | ||
* __Chrome__ `google-chrome --proxy-pac-url=http://localhost:2000/proxy.pac` | ||
* __Internet Explorer__ uses system network configuration. | ||
### OS X | ||
### System configuration | ||
`Network Preferences > Advanced > Proxies > Automatic Proxy Discovery` | ||
* __OS X__ `Network Preferences > Advanced > Proxies > Automatic Proxy Discovery` | ||
* __Windows__ `Settings > Network and Internet > Proxy > Use setup script` | ||
* __Linux__ depends on the distribution, use browser configuration as an alternative. | ||
### Windows | ||
`Settings > Network and Internet > Proxy > Use setup script` | ||
### Linux | ||
Check your network manager and look for proxy configuration. Use browser configuration as an alternative. | ||
## Browser configuration | ||
Browsers can be configured to use a specific proxy. Use this method as an alternative to system-wide configuration. | ||
### Chrome | ||
`google-chrome --proxy-pac-url=http://localhost:2000/proxy.pac` | ||
### Firefox | ||
`Preferences > Advanced > Network > Connection > Settings > Automatic proxy URL configuration` | ||
### Internet Explorer | ||
Uses system network configuration. | ||
## Troubleshooting | ||
Make sure that you have started `hotel` and that `http://localhost:2000/proxy.pac` is available when setting proxy auto-config URL. |
@@ -9,2 +9,3 @@ 'use strict'; | ||
var conf = require('../conf'); | ||
var tcpProxy = require('./tcp-proxy'); | ||
@@ -53,2 +54,24 @@ var app = express(); | ||
// Handle CONNECT, used by WebSockets when accessing .dev domains | ||
server.on('connect', function (req, socket, head) { | ||
var hostname = req.headers.host.split(':')[0]; | ||
var id = hostname.replace(/.dev$/, ''); | ||
if (hostname === 'hotel.dev') { | ||
util.log('Proxy socket to ' + conf.port); | ||
tcpProxy(socket, conf.port); | ||
} else if (servers.has(id)) { | ||
// Start server | ||
var _server = servers.start(id); | ||
// Target | ||
var PORT = _server.env.PORT; | ||
util.log('Proxy socket to ' + PORT); | ||
tcpProxy(socket, PORT); | ||
} else { | ||
util.log('Can\'t find server for http://' + hostname); | ||
socket.end(); | ||
} | ||
}); | ||
// Start server | ||
@@ -55,0 +78,0 @@ server.listen(conf.port, conf.host, function () { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var errorMsg = require('./error-msg'); | ||
var proxyPac = require('./proxy-pac'); | ||
var proxyPac = require('./views/proxy-pac'); | ||
@@ -11,0 +11,0 @@ module.exports = function (servers) { |
{ | ||
"name": "hotel", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Easily start, stop and access your servers from the browser", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
# hotel [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/hotel/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/hotel) [![Windows Build status](https://img.shields.io/appveyor/ci/typicode/hotel/master.svg?label=Windows)](https://ci.appveyor.com/project/typicode/hotel/branch/master) [![](https://badge.fury.io/js/hotel.svg)](https://www.npmjs.com/package/hotel) | ||
> Server manager for front-end devs ❤ | ||
> Classy process manager for web devs ❤ | ||
Just fire up a text editor, a browser and you're good to go. | ||
![](https://rawgit.com/typicode/hotel/master/screen.gif) | ||
_No need to worry about ports, remember commands, manage terminal tabs, ... you can even use local `.dev` domains and it works everywhere :+1:_ | ||
No need to worry about ports, remember commands, manage terminal tabs, ... access and start your servers from the browser. You can even use local `.dev` domains and it works everywhere :+1: | ||
@@ -22,3 +20,3 @@ ## Features | ||
_(*) Local `.dev` domains are optional. If you want to use them, you need to configure your browser or network to use `hotel`'s proxy auto-config file (`proxy.pac`). See instructions [here](https://github.com/typicode/hotel/docs)._ | ||
_(*) Local `.dev` domains are optional. If you want to use them, you need to configure your browser or network to use hotel's proxy auto-config file (`proxy.pac`). See instructions [here](https://github.com/typicode/hotel/blob/master/docs/README.md)._ | ||
@@ -113,3 +111,3 @@ ## Install | ||
See instructions [here](https://github.com/typicode/hotel/docs). | ||
See instructions [here](https://github.com/typicode/hotel/blob/master/docs/README.md). | ||
@@ -129,2 +127,3 @@ ## Configurations and logs | ||
[Hotel Clerk](https://github.com/therealklanni/hotel-clerk) OS X menubar | ||
[HotelX](https://github.com/djyde/HotelX) Another OS X menubar (only 1.6MB) | ||
@@ -131,0 +130,0 @@ ## License |
{ | ||
"optOut": false, | ||
"lastUpdateCheck": 1448410393142 | ||
"lastUpdateCheck": 1452142373988 | ||
} |
@@ -6,3 +6,3 @@ { | ||
"env": { | ||
"PATH": "/home/sonic/.nvm/versions/node/v0.12.5/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v0.12.5/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v0.12.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games", | ||
"PATH": "/home/sonic/.nvm/versions/node/v5.3.0/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v5.3.0/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v5.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games", | ||
"FOO": "foo", | ||
@@ -9,0 +9,0 @@ "PORT": 51234 |
@@ -5,4 +5,4 @@ { | ||
"env": { | ||
"PATH": "/home/sonic/.nvm/versions/node/v0.12.5/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v0.12.5/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v0.12.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" | ||
"PATH": "/home/sonic/.nvm/versions/node/v5.3.0/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v5.3.0/lib/node_modules/npm/bin/node-gyp-bin:/home/sonic/d/hotel/node_modules/.bin:/home/sonic/.nvm/versions/node/v5.3.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
176677
41
923
130
8