Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Adds proxy option for pushing. #40

Merged
merged 1 commit into from

2 participants

@rrjamie

Adds ability to use a proxy while pushing.

Uses HTTP_PROXY, http_proxy or

  mobify push -x http://proxy:8888/

Does not support proxy for tag injector

Ryan J Daw Adds proxy option for pushing.
  mobify push -x http://proxy:8888/
d31ccea
@noahadams
Owner

tested with proxy switch, environment variable and no proxy, works, +1

@noahadams noahadams merged commit 1ed2197 into master
@tedtate tedtate deleted the proxy_push_option branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. Adds proxy option for pushing.

    Ryan J Daw authored
      mobify push -x http://proxy:8888/
This page is out of date. Refresh to see the latest.
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']
Something went wrong with that request. Please try again.