|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-03-20 16:31 UTC] struman at nuparadigm dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 23 11:00:02 2025 UTC |
Apache 2.0.42 with SAPI module Default install with sockets module. When connecting to a java Servlet from PHP. Servlet always reports that port 80 is the port that it is being connected too. I can telnet to 127.0.0.1 8080 and issue GET /TestServlet HTTP/1.0 Host: 127.0.0.1 And the Servlet reports the correct port. Also reports the correct port when browing URL with Web Browser. Only in PHP does the port default to 80. My Guess it that sin_port is being set incorrectly. -- Test Code PHP -- $fp = fsockopen("127.0.0.1", 8080, $fsockopen_errnum, $fsockopen_errstr, $fsockopen_timeout); $sHeader = "GET " . "/TestServlet"; $sHeader .= " HTTP/1.0\r\n"; $sHeader .= "Host: 127.0.0.1\r\n\r\n"; fputs($fp, $sHeader); -- Servlet Code -- public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println("Serverport="+request.getServerPort()); }