Skip to content

add proxy example#425

Merged
ronag merged 4 commits intomasterfrom
proxy-example
Sep 22, 2020
Merged

add proxy example#425
ronag merged 4 commits intomasterfrom
proxy-example

Conversation

@ronag
Copy link
Copy Markdown
Member

@ronag ronag commented Sep 19, 2020

No description provided.

Comment thread examples/proxy/proxy.js Outdated

headers = getResponseHeaders(headers)

// TODO (perf): res.writeHead should support Array and/or string.
Copy link
Copy Markdown
Member Author

@ronag ronag Sep 19, 2020

Choose a reason for hiding this comment

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

@mcollina: It would be nice if core writeHead supported the key/value array directly without having to convert it into an object. Alternatively a string.

@ronag ronag force-pushed the proxy-example branch 12 times, most recently from 319cc3d to c3218b3 Compare September 20, 2020 07:17
Comment thread examples/proxy/index.js Outdated
Comment thread examples/proxy/index.js Outdated
Comment thread examples/proxy/proxy.js Outdated
Comment thread examples/proxy/index.js
@ronag ronag force-pushed the proxy-example branch 8 times, most recently from a5ccaa6 to 7419561 Compare September 20, 2020 13:40
@ronag
Copy link
Copy Markdown
Member Author

ronag commented Sep 20, 2020

@mcollina: This is starting to feel pretty solid. I think for an example it is good.

If we want to include it as a helper I believe we need to in addition to test also add some hooks for modifying req/res headers and maybe also the response body as well as options to disable forwarded. Not sure if informational headers and trailers are a must.

@ronag ronag force-pushed the proxy-example branch 2 times, most recently from 91a2faf to 51fcacc Compare September 20, 2020 14:23
Comment thread examples/proxy/proxy.js Outdated
Comment thread examples/proxy/proxy.js Outdated
@ronag ronag force-pushed the proxy-example branch 6 times, most recently from 370eb39 to 7ca6252 Compare September 21, 2020 07:34
Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag merged commit f533712 into master Sep 22, 2020
@ronag ronag deleted the proxy-example branch September 22, 2020 13:14
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