Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1818

Performance of com.sun.net.httpserver.HttpServer and HttpURLConnection?

$
0
0

I developed a HTTP proxy which makes HTTPS->HTTP conversion, using com.sun.net.httpserver.HttpsServer and HttpURLConnection. Unfortunately it can process only 5 little HTTPS POST request per second. All other requests can't connect to proxy.

I have apache with SSL + tomcat on the same server and it process 50 HTTPS request/sec. Tomcat without apache process 50 HTTP request/second to, so apache with SSL don't slow him at all. If i use my com.sun.net.httpserver.HttpsServer it slows tomcat 10x times! I use it in such way:

HttpsServer server = HttpsServer.create(new InetSocketAddress(config.getInPort()), 0);server.createContext("/https", new HttpProxyHandler(config));       server.setHttpsConfigurator(new HttpsConfigurator(SSLContext.getDefault()));server.setExecutor(null);server.start();

Handler only send received request to another http URL via HttpURLConnection.

Why the performance of com.sun.net.httpserver.HttpServer is so bad? Is any performance statistic of HttpsServer available? I need very performance server. What if i just read request from SSL socket and write to TCP socket? Will it be suitable for HTTPS request processing?


Viewing all articles
Browse latest Browse all 1818

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>