HttpsUrlConnection and keep-alive

后端 未结 8 1572
太阳男子
太阳男子 2020-12-08 02:27

I am using com.sun.net.httpserver.HttpsServer in my current project which deals with client-authentification etc.. Currently it only prints out the clients addr

相关标签:
8条回答
  • 2020-12-08 03:28

    try to add the following code:

    con.setRequestProperty("Connection", "Keep-Alive");
    con.setRequestProperty("Keep-Alive", "header");
    
    0 讨论(0)
  • 2020-12-08 03:30

    We may setup an Apache Webserver, add following directives to see whether the Apache's access.log has a keep-alive connection for the http client.

    LogFormat "%k %v %h %l %u %t \"%r\" %>s %b" common
    CustomLog "logs/access.log" common 
    

    http://httpd.apache.org/docs/current/mod/mod_log_config.html

    "%k" Number of keepalive requests handled on this connection. Interesting if KeepAlive is being used, so that, for example, a '1' means the first keepalive request after the initial one, '2' the second, etc...; otherwise this is always 0 (indicating the initial request).

    0 讨论(0)
提交回复
热议问题