sending http responses....

sending http responses....

am 15.04.2008 21:56:41 von harikris

Hi All,

I want to be able to respond to certain http client requests without
the webserver meddling with it.
How can i achieve that in php?

When i am use the header() function to send in the status line, like
header('HTTP/1.1 206 Partial Content'), i just want the webserver to
send it RAW or UN-TOUCHED to the client without adding some other
headers like "Connection: Close" on it's own.

I am using Cherokee webserver. I can transition to a different server
if need be.

I am using PHP version 5.2.4

One more thing - How do i make both the header and the content/body
go in the same IP/TCP datatgram/packet? When i wrap the header() and
echo() with ob_start() and ob_end_flush(), i expected the http headers
and the body to get delivered to the client as one packet (the payload
length is less then 1448 bytes in this case). But that's not what i
see when i sniff the traffic.

Thanks in advance.

Re: sending http responses....

am 15.04.2008 23:05:58 von Jerry Stuckle

harikris@gmail.com wrote:
> Hi All,
>
> I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> How can i achieve that in php?
>
> When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> I am using PHP version 5.2.4
>
> One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> Thanks in advance.
>

You can't do either. The web server will always be involved, no matter
what the programming language. And you can never guarantee how data
will be passed in the packets.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: sending http responses....

am 15.04.2008 23:05:58 von Jerry Stuckle

harikris@gmail.com wrote:
> Hi All,
>
> I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> How can i achieve that in php?
>
> When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> I am using PHP version 5.2.4
>
> One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> Thanks in advance.
>

You can't do either. The web server will always be involved, no matter
what the programming language. And you can never guarantee how data
will be passed in the packets.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: sending http responses....

am 24.04.2008 07:34:15 von tez1966

On Apr 15, 8:56=A0pm, "harik...@gmail.com" wrote:
> Hi All,
>
> =A0I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> =A0How can i achieve that in php?
>
> =A0When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> =A0I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> =A0I am using PHP version 5.2.4
>
> =A0One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> =A0Thanks in advance.



Certainly sounds like an interesting project, what is it you want to
achieve? Have you considered writing your own simple web server where
you can set some of the rules yourself?



*** PHP Programming in the North East of England
web: www.programmer4hire.co.uk ***

Re: sending http responses....

am 24.04.2008 07:34:15 von tez1966

On Apr 15, 8:56=A0pm, "harik...@gmail.com" wrote:
> Hi All,
>
> =A0I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> =A0How can i achieve that in php?
>
> =A0When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> =A0I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> =A0I am using PHP version 5.2.4
>
> =A0One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> =A0Thanks in advance.



Certainly sounds like an interesting project, what is it you want to
achieve? Have you considered writing your own simple web server where
you can set some of the rules yourself?



*** PHP Programming in the North East of England
web: www.programmer4hire.co.uk ***

Re: sending http responses....

am 24.04.2008 13:36:22 von Jerry Stuckle

tez1966@googlemail.com wrote:
> On Apr 15, 8:56 pm, "harik...@gmail.com" wrote:
>> Hi All,
>>
>> I want to be able to respond to certain http client requests without
>> the webserver meddling with it.
>> How can i achieve that in php?
>>
>> When i am use the header() function to send in the status line, like
>> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
>> send it RAW or UN-TOUCHED to the client without adding some other
>> headers like "Connection: Close" on it's own.
>>
>> I am using Cherokee webserver. I can transition to a different server
>> if need be.
>>
>> I am using PHP version 5.2.4
>>
>> One more thing - How do i make both the header and the content/body
>> go in the same IP/TCP datatgram/packet? When i wrap the header() and
>> echo() with ob_start() and ob_end_flush(), i expected the http headers
>> and the body to get delivered to the client as one packet (the payload
>> length is less then 1448 bytes in this case). But that's not what i
>> see when i sniff the traffic.
>>
>> Thanks in advance.
>
>
>
> Certainly sounds like an interesting project, what is it you want to
> achieve? Have you considered writing your own simple web server where
> you can set some of the rules yourself?
>
>
>
> *** PHP Programming in the North East of England
> web: www.programmer4hire.co.uk ***
>
>

He'd also have to write his own TCP/IP so he can control what goes into
the packets.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: sending http responses....

am 24.04.2008 13:36:22 von Jerry Stuckle

tez1966@googlemail.com wrote:
> On Apr 15, 8:56 pm, "harik...@gmail.com" wrote:
>> Hi All,
>>
>> I want to be able to respond to certain http client requests without
>> the webserver meddling with it.
>> How can i achieve that in php?
>>
>> When i am use the header() function to send in the status line, like
>> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
>> send it RAW or UN-TOUCHED to the client without adding some other
>> headers like "Connection: Close" on it's own.
>>
>> I am using Cherokee webserver. I can transition to a different server
>> if need be.
>>
>> I am using PHP version 5.2.4
>>
>> One more thing - How do i make both the header and the content/body
>> go in the same IP/TCP datatgram/packet? When i wrap the header() and
>> echo() with ob_start() and ob_end_flush(), i expected the http headers
>> and the body to get delivered to the client as one packet (the payload
>> length is less then 1448 bytes in this case). But that's not what i
>> see when i sniff the traffic.
>>
>> Thanks in advance.
>
>
>
> Certainly sounds like an interesting project, what is it you want to
> achieve? Have you considered writing your own simple web server where
> you can set some of the rules yourself?
>
>
>
> *** PHP Programming in the North East of England
> web: www.programmer4hire.co.uk ***
>
>

He'd also have to write his own TCP/IP so he can control what goes into
the packets.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: sending http responses....

am 24.04.2008 13:41:05 von gordon

On Apr 15, 8:56 pm, "harik...@gmail.com" wrote:
> Hi All,
>
> I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> How can i achieve that in php?
>
> When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> I am using PHP version 5.2.4
>
> One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> Thanks in advance.

You might be able to use the PHP header() command to override headers
that the web server's sending with values you want, for example you
could change connection to not be close. I can't promise that would
work though as I've never tested it.

As for the packets, can't be done. TCP/IP by its nature makes no
promises about the order packets are delivered in. How could it? You
have no way of knowing the network conditions from one packet to the
next, so you can't predict how long a packet is going to take to
transmit or if it's even going to reach its destination at all. If a
packet goes astray then the client can re-request it, if they arrive
out of order then it's up to the client to reassemble them in order.
It's done this way because it's more robust than sending entire
messages in one go. If there's an error or failure part way through a
file that was being transmitted as a single entity you'd have to
transmit the entire file again.

Re: sending http responses....

am 24.04.2008 13:41:05 von gordon

On Apr 15, 8:56 pm, "harik...@gmail.com" wrote:
> Hi All,
>
> I want to be able to respond to certain http client requests without
> the webserver meddling with it.
> How can i achieve that in php?
>
> When i am use the header() function to send in the status line, like
> header('HTTP/1.1 206 Partial Content'), i just want the webserver to
> send it RAW or UN-TOUCHED to the client without adding some other
> headers like "Connection: Close" on it's own.
>
> I am using Cherokee webserver. I can transition to a different server
> if need be.
>
> I am using PHP version 5.2.4
>
> One more thing - How do i make both the header and the content/body
> go in the same IP/TCP datatgram/packet? When i wrap the header() and
> echo() with ob_start() and ob_end_flush(), i expected the http headers
> and the body to get delivered to the client as one packet (the payload
> length is less then 1448 bytes in this case). But that's not what i
> see when i sniff the traffic.
>
> Thanks in advance.

You might be able to use the PHP header() command to override headers
that the web server's sending with values you want, for example you
could change connection to not be close. I can't promise that would
work though as I've never tested it.

As for the packets, can't be done. TCP/IP by its nature makes no
promises about the order packets are delivered in. How could it? You
have no way of knowing the network conditions from one packet to the
next, so you can't predict how long a packet is going to take to
transmit or if it's even going to reach its destination at all. If a
packet goes astray then the client can re-request it, if they arrive
out of order then it's up to the client to reassemble them in order.
It's done this way because it's more robust than sending entire
messages in one go. If there's an error or failure part way through a
file that was being transmitted as a single entity you'd have to
transmit the entire file again.