grunt-proxy
grunt-proxy copied to clipboard
Proxy not working
I am able to do proxy by using curl
curl -x 1.2.3.4:8008 http://remote-app-host/
<!DOCTYPE html>
<html>
<head>
<title>WebPagetest - Website Performance and Optimization Test</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<meta name="keywords" content="Webpagetest,Website Speed Test,Page Speed">
<meta name="description" content="Run a free website speed test from around the globe using real browsers at consumer connection speeds with detailed optimization recommendations.">
<meta name="author" content="Patrick Meenan">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
</script>
<script type="text/javascript" src="/js/test.js?v=29"></script>
</body>
</html>
The following Gruntfile.js doesn't take the webpagetest bypassing the proxy
/*
* grunt-perfbudget
* https://github.com/tkadlec/grunt-perfbudget
*
* Copyright (c) 2014 Tim Kadlec
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
proxy: {
proxy1 : {
options : {
port : 80,
host : 'localhost',
target : {
host: 'http://1.2.3.4',
port: 8008
}
}
}
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['tmp']
},
// Configuration to be run (and then tested).
perfbudget: {
foo: {
options: {
url: 'http://google.com',
wptInstance: 'http://remote-app-host',
location: 'Local4-WPTDriver',
budget: {
SpeedIndex: '1500'
}
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/*_test.js']
}
});
// Actually load this plugin's task(s).
grunt.loadTasks('tasks');
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-proxy');
// Whenever the "test" task is run, first clean the "tmp" dir, then run this
// plugin's task(s), then test the result.
grunt.registerTask('test', ['clean', 'perfbudget']);
// By default, lint and run all tests.
grunt.registerTask('default', ['proxy', 'test']);
};
And I am getting
grunt
Running "proxy:proxy1" (proxy) task
Running "clean:tests" (clean) task
Running "perfbudget:foo" (perfbudget) task
>> ETIMEDOUT connect ETIMEDOUT
I ran above with root so I made sure 80 port can be forwarded.
Would you please advise if my proxy configuration is correct?
@canadatom Did you get it to work?