Skip to content

Include proxy support#28

Open
westlakem wants to merge 3 commits into
bespoken:masterfrom
westlakem:master
Open

Include proxy support#28
westlakem wants to merge 3 commits into
bespoken:masterfrom
westlakem:master

Conversation

@westlakem

Copy link
Copy Markdown

Our workspace required us to go through proxy authentication to hit an outside server (which is where our code is stored). This PR is what allowed us to use this package through the proxy.

@codecov

codecov Bot commented Jun 25, 2018

Copy link
Copy Markdown

Codecov Report

Merging #28 into master will decrease coverage by 0.17%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #28      +/-   ##
==========================================
- Coverage   93.51%   93.33%   -0.18%     
==========================================
  Files          14       14              
  Lines         447      450       +3     
  Branches       45       46       +1     
==========================================
+ Hits          418      420       +2     
- Misses         29       30       +1
Impacted Files Coverage Δ
src/Invoker.ts 89.7% <75%> (-1.07%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d119bc5...71229bb. Read the comment docs.

@jperata jperata left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great feedback on how to use it with proxy, but current implementation it's difficult to test and to add to different libraries.

Would it be possible for you to add the changes and a test for this.
If not i will make the updates on this PR as soon as i finish on a different change (#22) that's on the way.

Comment thread README.md

### Proxy settings

If you need to use a custom proxy, just set your `HTTP_PROXY` environment variable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use and env variable makes it difficult to use this library as part of other solutions, for example we plan on adding it to bst tools so that you can use similar commands to alexa.
It should be added as part of the VirtualGoogleAssistantBuilder

Comment thread src/Invoker.ts

export class Invoker {
public static async invokeExpressFile(fileName: string, port: number, jsonRequest: any, restOfPath?:string): Promise<any> {
public static async invokeExpressFile(fileName: string, port: number, jsonRequest: any, restOfPath?: string): Promise<any> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should include an extra parameter for the proxy.

Comment thread src/Invoker.ts
port: url.port ? parseInt(url.port, 10) : undefined,
};

if(process.env.http_proxy){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should come from the constructor instead of env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants