PHP Classes

Different port numbers

Recommend this page to a friend!

      HTTP client class  >  All threads  >  Different port numbers  >  (Un) Subscribe thread alerts  
Subject:Different port numbers
Summary:Pick custom port no from
Messages:1
Author:Kai Becker
Date:2010-06-30 12:12:46
 

  1. Different port numbers   Reply   Report abuse  
Picture of Kai Becker Kai Becker - 2010-06-30 12:12:46
I had to connect to an unusual port number, so I inserted the following line after "$urlParsed = parse_url($this->target);" in execute():

if(empty($this->port) && !empty($urlParsed['port']))
$this->port = $urlParsed['port'];

This supports URL of the form <protocol>://<server>:<portno>/...

I also suggest to add a method setPort($portno) to the class.