Skip to content
Browse files

Merge pull request #40 from mobify/proxy_push_option

Adds proxy option for pushing.
  • Loading branch information...
2 parents 44a8455 + d31ccea commit 1ed2197eef6047a5f81e11e2567db5eeb6f42626 @noahadams noahadams committed Oct 9, 2012
Showing with 10 additions and 0 deletions.
  1. +1 −0 src/api.coffee
  2. +1 −0 src/mobify.coffee
  3. +8 −0 src/utils.coffee
View
1 src/api.coffee
@@ -13,6 +13,7 @@ exports.post = post = (options, path, data, callback) ->
headers:
'Content-Length': dataBuffer.length
'User-Agent': Utils.getUserAgent()
+ proxy: options.proxy || Utils.getProxy()
request = Request opts, (err, response, body) ->
if err
View
1 src/mobify.coffee
@@ -32,6 +32,7 @@ program
.option('-e, --endpoint <endpoint>', 'set the API endpoint eg. https://cloud.mobify.com/api/')
.option('-u, --auth <auth>', 'username and API Key eg. username:apikey')
.option('-p, --project <project>', 'override the project name in project.json for the push destination')
+ .option('-x, --proxy <proxy url>', 'use the specified proxy. URL in the format http://[username:password@]PROXY_HOST:PROXY_PORT/')
.action Commands.push
program
View
8 src/utils.coffee
@@ -369,3 +369,11 @@ exports.compressJs = compressJs = (js) ->
ast = Uglify.uglify.ast_mangle ast
ast = Uglify.uglify.ast_squeeze ast
Uglify.uglify.gen_code ast
+
+
+###
+Gets the system proxy
+
+###
+exports.getProxy = () ->
+ return process.env['http_proxy'] or process.env['HTTP_PROXY']

0 comments on commit 1ed2197

Please sign in to comment.
Something went wrong with that request. Please try again.