![]() | |
| |||||||
| Home | Register | Blogs | FAQ | Members List | Calendar | Downloads | Arcade | Mark Forums Read |
| Web Development Java/PHP/Perl/ASP and more |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| Студент Join Date: Mar 2002 Location: [ Surrealistical World ]
Posts: 312
Rep Power: 7 Reputation:
10 | 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. |
| | |
| | #2 |
| Студент Join Date: Jun 2002 Location: Yerevan
Posts: 258
Rep Power: 7 Reputation:
10 | 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 |
| | |
| | #3 |
| Студент Join Date: Mar 2002 Location: [ Surrealistical World ]
Posts: 312
Rep Power: 7 Reputation:
10 | 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..
__________________ ::Against the crowd. |
| | |
| | #4 |
| Студент Join Date: Jun 2002 Location: Yerevan
Posts: 258
Rep Power: 7 Reputation:
10 | 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 )
__________________ http://www.d-brane.com |
| | |