Skip to content

Instantly share code, notes, and snippets.

@isterin
Created January 2, 2018 20:39
Show Gist options
  • Save isterin/5ea0ce541b05df29963c4c47513eea8b to your computer and use it in GitHub Desktop.
Save isterin/5ea0ce541b05df29963c4c47513eea8b to your computer and use it in GitHub Desktop.
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