2013/6/10 Anil Goyal -X (anigoyal - Aricent Technologies at Cisco) <anigo...@cisco.com>: > Hi > > I am trying to create a http client and send a request to certain port of a > server using below code: > > HttpClient client = new HttpClient(); > client.getHostConfiguration().setHost(address, portNumber, protocol); > > Here portNumber that I am setting is 8444(https port of tomcat) > > When I execute client.executemethod() and at the server side when I tried to > retrieve request.getRequestURL(), I am getting the url with port 443 not 8444 > which I set in client. Even request.getServerPort is giving 443 not 8444. > > The things are working fine for 8081(http port of tomcat) i..e > HttpClient client = new HttpClient(); > client.getHostConfiguration().setHost(address, portNumber, protocol); > > Here portNumber that I am setting is 8081(https port of tomcat) > When I execute client.executemethod() and at the server side when I tried to > retrieve request.getRequestURL(), I am getting the url with port 8081 which I > set in client. Even request.getServerPort is giving 8081. >
1. Your OS = ? 2. Version of HttpClient = ? Is it Apache HttpClient (hc.apache.org)? 3. Version of Tomcat = ? 4. What connector implementations (BIO, NIO, APR) and on which ports are configured in Tomcat? They should be mentioned in the logs when Tomcat starts. 5. Are you sure that your HttpClient connects to port 8444? What if you use a web browser? What if you list active connections (using netstat or some other tool)? 6. Does it connect directly to Tomcat, or some proxy (Apache Httpd, iptables, a NAT on a router) is involved? > request.getServerPort Configure an AccessLogValve. %p in the log pattern should be able to print the ServerPort value. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org