Last active
August 29, 2015 14:21
-
-
Save smaldini/5d93da9aa606b12e4069 to your computer and use it in GitHub Desktop.
a simple proxy
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
HttpServer<Buffer, Buffer> server = NetStreams.httpServer("0.0.0.0", 80); | |
server.get("/search/{search}", requestIn -> | |
NetStreams.httpClient() | |
.get("http://google.co.uk/?q=" + requestIn.param("search")) | |
.flatMap(repliesOut -> requestIn.writeWith(repliesOut)) | |
); | |
server.start().await(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment