flipkart-incubator / phantom

Phantom is a high performance proxy for accessing distributed services. It is an RPC system with support for different transports and protocols. Phantom is inspired by Twitter Finagle clients and builds on the capabilities of technologies like Netty, Unix Domain Sockets, Netflix Hystrix and Spring. Phantom proxies have been used to serve several hundred million API calls in production deployments at Flipkart.
49 stars 27 forks source link

Proxy CONNECT Aborted #51

Closed adisrika closed 8 years ago

adisrika commented 8 years ago

On Client Side

MT-C02HL1FYDV16:sample-http-proxy srikanth.adimulam$ curl --proxy "http://localhost:8080" https://seller.flipkart.com curl: (56) Proxy CONNECT aborted

On proxy terminal

10:17:11.861 [New I/O server worker #1-1] ERROR c.f.p.r.i.s.n.h.h.RoutingHttpChannelHandler - Exception thrown on Channel. Disconnect initiated : java.lang.NullPointerException: Span name should not be null. java.lang.NullPointerException: Span name should not be null. at org.apache.commons.lang3.Validate.notBlank(Validate.java:448) ~[commons-lang3-3.1.jar:3.1] at com.github.kristofa.brave.ServerTracerImpl.setStateUnknown(ServerTracerImpl.java:92) ~[brave-impl-2.2.1.jar:na] at com.flipkart.phantom.task.impl.interceptor.ServerRequestInterceptor.process(ServerRequestInterceptor.java:71) ~[task-1.4.2-SNAPSHOT.jar:na] at com.flipkart.phantom.runtime.impl.server.netty.handler.http.RoutingHttpChannelHandler.initializeServerTracing(RoutingHttpChannelHandler.java:295) ~[channel-handler-http-1.4.2-SNAPSHOT.jar:na] at com.flipkart.phantom.runtime.impl.server.netty.handler.http.RoutingHttpChannelHandler.messageReceived(RoutingHttpChannelHandler.java:213) ~[channel-handler-http-1.4.2-SNAPSHOT.jar:na] at org.jboss.netty.handler.codec.http.HttpChunkAggregator.messageReceived(HttpChunkAggregator.java:111) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.handler.codec.replay.ReplayingDecoder.unfoldAndFireMessageReceived(ReplayingDecoder.java:522) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:501) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:438) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:343) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:274) ~[netty-3.3.1.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:194) ~[netty-3.3.1.Final.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_60] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]

regunathb commented 8 years ago

What version is this on? Can you please try the latest : 1.4.2-SNAPSHOT and let us know how it goes? Btw, the sample provided is for Http and I can see that you are trying to use it for Https. For Https to work, you will need to add the SslHandler in the "httpChannelPipelineFactory" bean along with the other Http codecs : https://github.com/Flipkart/phantom/blob/master/sample-http-proxy/src/main/resources/external/spring-proxy-listener-config.xml

adisrika commented 8 years ago

Checked i am using the latest by verifying CHANGELOG. Tried a http site curl --proxy "http://localhost:8080" "http://www.htp.gov.in/" Now i don't see any error but don't see any response

regunathb commented 8 years ago

Are you sure you are running the Phantom proxy the right way? The destination address is not specified the way you have mentioned in your curl command. Please check the Wiki doc for setting it up.