Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development
Register

Reply
 
LinkBack Thread Tools
Old 22.07.2002, 07:41   #1
Студент
 
Join Date: 03 2002
Location: [ Surrealistical World ]
Posts: 312
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post Proxy::

Heya.

How are you. Look. I'm writing a proxy server. Let's assume that it is running on localhost.
I'm configuring my browser's proxy for localhost, then trying to connect to a site. What proxy server has to do is to reply to any requests on xxxx port a simple html. So. I type 'http://xxxxxxx', browser starts to 'navigate'. It lasts till I CLOSE the proxy server. When I EXIT it, browser shows that HTML that proxy server sends. Question:: WHY??
Kstatye, a ved' inogda on pokazyvaet srazu... Stranno.
Maybe I should send some special character after data?? [EOF ya uzhe proboval - ne rabotaet].

Rgdz,
SiLVER..
__________________
::Against the crowd.
Reply With Quote
Old 22.07.2002, 09:23   #2
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Esli data kotoryj ty posylaesh' browser-u ne chunked, to togda ty Content-Length specify delaesh' v response? A esli chunked to 0 v konce ne zabud'. Esli ne ot etogo skagi chto imenno posylaesh' v http header-e, razberemsya. Posmotri esche Connection field.

Vot rfc:
http://www.w3.org/Protocols/rfc2616/rfc2616.html
__________________
http://www.d-brane.com
Reply With Quote
Old 23.07.2002, 09:06   #3
Студент
 
Join Date: 03 2002
Location: [ Surrealistical World ]
Posts: 312
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Hello Eddi.

Actually the matter was in the other thing...
I'll explain it for future if someone will have that question.
Look. When a browser sends you a connection request, you accept his connection, therefore open a new socket for him, and start to work through that socket. Well I tried everything to show the browser that I'm over with data... Nothing helped... Neither Content-Length, nor sending even EOF. The answer is MUUUUCH simpler You have just to CLOSE that socket when Winsock_SendComplete() event is generated by Windows. Anyway thanks.

Regards,
SiLVER..
Reply With Quote
Old 23.07.2002, 10:16   #4
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Good then
Just one note. Connection field specifies what should happen to the connection, and if the browser sends you keep-alive, then I guess you don't need to close it, otherwise, if it sends you close, you have to close it. (that's why I told to look up the connection field in rfc, there are some other notes there about what proxies themselves are supposed to send to the host they are connecting to )
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 00:41.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.