[Klone-users] Connected port.

Stefano Barbato barbato at koanlogic.com
Wed Dec 19 05:43:13 EST 2007


Hi Radek,

On 19/dic/07, at 09:51, thomas fossati wrote:

> Hi Radek,
>
> On Dec 19, 2007, at 8:09 AM, Radek wrote:
>> But I do not know how to recognize which port/protocol the client  
>> uses.
>
> You can use io_is_secure() function.


you can also get the address of the client and the server using  
request_get_addr() and request_get_peer_addr() functions. This is an  
example:


---[ my.kl1 ]---
<%
addr_t *local, *peer;

local = request_get_addr(request);
peer = request_get_peer_addr(request);

io_printf(out, "local %s:%d <p>",
	inet_ntoa(local->sa.sin.sin_addr),
	ntohs(local->sa.sin.sin_port));

io_printf(out, "peer %s:%d <p>",
	inet_ntoa(peer->sa.sin.sin_addr),
	ntohs(peer->sa.sin.sin_port));
%>
----------------

bye,
s




More information about the Klone-users mailing list