Source<IncomingConnection, CompletionStage<ServerBinding>> serverSource = Http.get(system).bind(ConnectWithHttps.toHost("localhost", LOCAL_PORT), materializer); Authorization authorization = Authorization.basic(USERNAME, PASSWORD);
Flow<HttpRequest, HttpRequest, NotUsed> applySecurity = Flow.of(HttpRequest.class) .map(request -> request.addHeader(authorization));
Flow<HttpRequest, HttpResponse, CompletionStage<OutgoingConnection>> forwardToProxy = Http.get(system).outgoingConnection(ConnectWithHttps.toHost(PROXY_ADDRESS, PROXY_PORT));
Flow<HttpRequest, HttpResponse, NotUsed> handler = Flow.of(HttpRequest.class) .via(applySecurity) .via(forwardToProxy);
serverSource.to(Sink.foreach(conn -> { System.out.println("Accepted new connection from " + conn.remoteAddress()); conn.handleWith(handler, materializer); } )).run(materializer);[WARN] [04/14/2016 00:07:28.480] [MyActorSystem-akka.actor.default-dispatcher-13] [akka.actor.ActorSystemImpl(MyActorSystem)] Illegal request, responding with status '400 Bad Request': Request is missing required `Host` header: 'Host' header value of request to `eg.linkedin.com:443` doesn't match request target authority: Host header: Some(Host: eg.linkedin.com:443)
Is there any tutorial or example related to Https with akka-Http[java]?
Thanks
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.