New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added unix domain socket support to http.proxy #1813

Merged
merged 1 commit into from Jul 3, 2017

Conversation

Projects
None yet
3 participants
@georgi-d

georgi-d commented Jul 3, 2017

  • changed the HTTPReverseProxySettings class to hold a destination URL instead
    of (host, port)
  • added reverseProxyRequest overload with URL
  • updated the proxy handler logic
  • made getFilteredHost() public
@s-ludwig

Using a URL for the proxy destination makes a lot of sense! It's a welcome side-effect that this this also enables HTTPS destinations.

Show outdated Hide outdated http/vibe/http/client.d
@@ -1118,7 +1118,7 @@ final class HTTPClientResponse : HTTPResponse {
}
/** Returns clean host string. In case of unix socket it performs urlDecode on host. */
private auto getFilteredHost(URL url)
auto getFilteredHost(URL url)

This comment has been minimized.

@s-ludwig

s-ludwig Jul 3, 2017

Member

I'd leave this as package for now, because the place here isn't really fitting for a public API.

@s-ludwig

s-ludwig Jul 3, 2017

Member

I'd leave this as package for now, because the place here isn't really fitting for a public API.

Show outdated Hide outdated http/vibe/http/proxy.d
/// The destination port to forward requests to
ushort destinationPort;
/// The destination URL to forward requests to
URL destination;

This comment has been minimized.

@s-ludwig

s-ludwig Jul 3, 2017

Member

This should get some backwards-compatibility properties:

/// Scheduled for deprecation - use `destination.host` instead.
@property ushort destinationPort() const { return destination.port; }
/// ditto
@property void destinationPort(ushort port) { destination.port = port; }

/// Scheduled for deprecation - use `destination.host` instead.
@property string destinationHost() const { return destination.host; }
/// ditto
@property void destinationHost(string host) { destination.host = host; }

To make that fully work, there would also need to be a default value of URL("http", "") for destination.

@s-ludwig

s-ludwig Jul 3, 2017

Member

This should get some backwards-compatibility properties:

/// Scheduled for deprecation - use `destination.host` instead.
@property ushort destinationPort() const { return destination.port; }
/// ditto
@property void destinationPort(ushort port) { destination.port = port; }

/// Scheduled for deprecation - use `destination.host` instead.
@property string destinationHost() const { return destination.host; }
/// ditto
@property void destinationHost(string host) { destination.host = host; }

To make that fully work, there would also need to be a default value of URL("http", "") for destination.

This comment has been minimized.

@georgi-d

georgi-d Jul 3, 2017

Thanks for the review. I will address the comments.

@georgi-d

georgi-d Jul 3, 2017

Thanks for the review. I will address the comments.

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Jul 3, 2017

Codecov Report

Merging #1813 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
- Coverage   37.05%   37.01%   -0.04%     
==========================================
  Files          81       81              
  Lines       10885    10895      +10     
==========================================
  Hits         4033     4033              
- Misses       6852     6862      +10
Impacted Files Coverage Δ
http/vibe/http/client.d 65.97% <ø> (ø) ⬆️
http/vibe/http/proxy.d 0% <0%> (ø) ⬆️

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 0437d5d...c893e97. Read the comment docs.

codecov bot commented Jul 3, 2017

Codecov Report

Merging #1813 into master will decrease coverage by 0.03%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1813      +/-   ##
==========================================
- Coverage   37.05%   37.01%   -0.04%     
==========================================
  Files          81       81              
  Lines       10885    10895      +10     
==========================================
  Hits         4033     4033              
- Misses       6852     6862      +10
Impacted Files Coverage Δ
http/vibe/http/client.d 65.97% <ø> (ø) ⬆️
http/vibe/http/proxy.d 0% <0%> (ø) ⬆️

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 0437d5d...c893e97. Read the comment docs.

Added unix domain socket support to http.proxy
- changed the HTTPReverseProxySettings class to hold a destination URL instead
of (host, port)
- added reverseProxyRequest overload with URL
- updated the proxy handler logic
- made getFilteredHost() package level
@georgi-d

This comment has been minimized.

Show comment
Hide comment
@georgi-d

georgi-d Jul 3, 2017

I have addressed the comments.

georgi-d commented Jul 3, 2017

I have addressed the comments.

@s-ludwig

Okay, thanks! Looks good to merge now.

@s-ludwig s-ludwig merged commit 64a63e2 into vibe-d:master Jul 3, 2017

2 of 4 checks passed

codecov/patch 0% of diff hit (target 37.05%)
Details
codecov/project 37.01% (-0.04%) compared to 0437d5d
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment