Comparing version 0.4.16 to 0.4.17
# Change Log | ||
## 0.4.17 | ||
* Add `proxy` conf, use it if you're behind a corporate proxy. | ||
* Bug fix | ||
## 0.4.16 | ||
* Fix issue with project names containing characters not allowed for a domain name. By default, `hotel add` will now replace spaces and `_` characters in project names. | ||
* Fix issue with project names containing characters not allowed for a domain name. By default, `hotel add` will now convert name to lower case and will replace space and `_` characters. However, you can still use `-n` to force a specific name or specific characters. | ||
@@ -7,0 +12,0 @@ ## 0.4.15 |
@@ -8,3 +8,3 @@ 'use strict'; | ||
require('font-awesome/css/font-awesome.css'); | ||
require('./style.scss'); | ||
require('./style.css'); | ||
@@ -11,0 +11,0 @@ /* eslint-disable no-new */ |
@@ -22,3 +22,6 @@ 'use strict'; | ||
timeout: 5000, | ||
tld: 'dev' | ||
tld: 'dev', | ||
// Replace with your network proxy IP (1.2.3.4:5000) if any | ||
// For example, if you're behind a corporate proxy | ||
proxy: false | ||
}; | ||
@@ -25,0 +28,0 @@ |
@@ -22,16 +22,19 @@ 'use strict'; | ||
var proxy = httpProxy.createProxyServer(); | ||
// Take a req and extract server id based on host | ||
function parseReq(req) { | ||
var _req$headers$host$spl = req.headers.host.split(':'); | ||
if (req.headers.host) { | ||
var _req$headers$host$spl = req.headers.host.split(':'); | ||
var _req$headers$host$spl2 = _slicedToArray(_req$headers$host$spl, 2); | ||
var _req$headers$host$spl2 = _slicedToArray(_req$headers$host$spl, 2); | ||
var hostname = _req$headers$host$spl2[0]; | ||
var port = _req$headers$host$spl2[1]; | ||
var hostname = _req$headers$host$spl2[0]; | ||
var port = _req$headers$host$spl2[1]; | ||
var regexp = new RegExp('.' + conf.tld + '$'); | ||
var id = hostname.replace(regexp, ''); | ||
return { id: id, port: port }; | ||
var regexp = new RegExp('.' + conf.tld + '$'); | ||
var id = hostname.replace(regexp, ''); | ||
return { id: id, port: port }; | ||
} else { | ||
util.log('No host header found'); | ||
return {}; | ||
} | ||
} | ||
@@ -42,2 +45,3 @@ | ||
var server = http.createServer(app); | ||
var proxy = httpProxy.createProxyServer(); | ||
@@ -44,0 +48,0 @@ // Initialize routes |
@@ -11,3 +11,3 @@ 'use strict'; | ||
var handleError = function handleError(err) { | ||
if (err) util.log(err); | ||
util.log(err); | ||
source.destroy(); | ||
@@ -14,0 +14,0 @@ target.destroy(); |
@@ -5,3 +5,13 @@ 'use strict'; | ||
// Tells the browser to proxy *.dev URLs to hotel | ||
module.exports = 'function FindProxyForURL (url, host) {\n if (dnsDomainIs(host, \'.' + conf.tld + '\')) return \'PROXY 127.0.0.1:' + conf.port + '\'\n return \'DIRECT\'\n}\n'; | ||
// Proxy only *.tld requests to hotel (.dev by default) | ||
// Send direct all other traffic | ||
var simple = 'function FindProxyForURL (url, host) {\n if (dnsDomainIs(host, \'.' + conf.tld + '\')) {\n return \'PROXY 127.0.0.1:' + conf.port + '\';\n }\n\n return \'DIRECT\';\n}\n'; | ||
// Same as above, except that it lets you use hotel behind a corporate proxy. | ||
// Set conf.proxy in ~/.hotel/conf.json to your proxy address and port. | ||
// For example: { proxy: '1.2.3.4:5000' } | ||
// | ||
// See also https://en.wikipedia.org/wiki/Private_network | ||
var withProxy = 'function FindProxyForURL (url, host) {\n if (dnsDomainIs(host, \'.' + conf.tld + '\')) {\n return \'PROXY 127.0.0.1:' + conf.port + '\';\n }\n\n var address = dnsResolve(host);\n if (\n isPlainHostName(host) ||\n dnsDomainIs(host, \'.local\') ||\n isInNet(address, \'10.0.0.0\', \'255.0.0.0\') ||\n isInNet(address, \'172.16.0.0\', \'255.240.0.0\') ||\n isInNet(address, \'192.168.0.0\', \'255.255.0.0\') ||\n isInNet(address, \'127.0.0.0\', \'255.255.255.0\')\n ) {\n return \'DIRECT\';\n }\n\n return \'PROXY ' + conf.proxy + '\';\n}\n'; | ||
module.exports = conf.proxy ? simple : withProxy; |
{ | ||
"name": "hotel", | ||
"version": "0.4.16", | ||
"version": "0.4.17", | ||
"description": "Easily start, stop and access your servers from the browser", | ||
@@ -84,5 +84,5 @@ "main": "lib", | ||
"mock-fs": "^3.6.0", | ||
"node-sass": "^3.4.2", | ||
"nodemon": "^1.8.1", | ||
"sass-loader": "^3.2.0", | ||
"postcss-loader": "^0.8.2", | ||
"postcss-simple-vars": "^1.2.0", | ||
"sinon": "^1.17.3", | ||
@@ -89,0 +89,0 @@ "standard": "^4.5.4", |
const webpack = require('webpack') | ||
const simpleVars = require('postcss-simple-vars') | ||
@@ -21,8 +22,4 @@ module.exports = { | ||
{ | ||
test: /\.scss$/, | ||
loaders: ['style', 'css', 'sass'] | ||
}, | ||
{ | ||
test: /\.css$/, | ||
loaders: ['style', 'css'] | ||
loaders: ['style', 'css', 'postcss'] | ||
}, | ||
@@ -36,2 +33,3 @@ { | ||
plugins: [ | ||
// window.fetch polyfill | ||
new webpack.ProvidePlugin({ | ||
@@ -41,3 +39,6 @@ 'Promise': 'es6-promise', | ||
}) | ||
] | ||
], | ||
postcss: function () { | ||
return [simpleVars] | ||
} | ||
} |
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
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
1333302
6302