php-ffi icon indicating copy to clipboard operation
php-ffi copied to clipboard

Can PHP stream be passed as argument?

Open Tatikoma opened this issue 7 years ago • 1 comments

Hello,

Please help me, can i with this library write something like this:

status = getsockopt(acceptedSocket, SOL_IP, SO_ORIGINAL_DST, (struct sockaddr *) &destaddr, &destlen);

? - I want get SO_ORIGINAL_DST socket property accepted with PHP via stream_socket_accept.

It would be great functionaly for creating transparent proxies with PHP.

Thanks in advance.

Tatikoma avatar Dec 10 '18 10:12 Tatikoma

No. php stream is not going to be automatically converted to integer file descriptor, and it seems, PHP doesn't expose any function to get file descriptor from a stream.

dstogov avatar Dec 10 '18 11:12 dstogov