Created
January 2, 2018 20:39
-
-
Save isterin/5ea0ce541b05df29963c4c47513eea8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProxiedHttpRequest(val req:HttpRequest) { | |
lazy val proxyServer = InetAddress.getByName(“some.proxy.com”) | |
} | |
object ProxiedHttpRequest { | |
implicit def delegateToOriginalHttpRequest( | |
r: ProxiedHttpRequest):HttpRequest = r.req | |
} | |
object Application { | |
def proxyRequest(req:ProxiedHttpRequest) { | |
val where = req.proxyServer | |
val headers = req.headers() // No more req.req ugliness | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment