this thing kind of works... i have connected my webbrowser to 8181 for
testing... im looking for help, everything i try produce the same
resaults... i dont really want to bother with event machines
this thing kind of works... i have connected my webbrowser to 8181 for
testing... im looking for help, everything i try produce the same
resaults... i dont really want to bother with event machines
And what exactly do you need help with?
Cheers
robert
so, my code has a few problems, the web browser will only load a few
pages and the connection will always stay open as if the browser is
waiting for more data...
i was thinking maybe i need 2 or 3 threads to handle both sides...
Thread.start{ receive_get from webbrowser }#step one
Thread.start{ send_get to webserver } #step two
Thread.start{ send_response to webbrowser }#step three
if i understand, the first step i need to gather a host: field
then establish a connection to the host web server
and pass the response back to the web client...
this thing kind of works... i have connected my webbrowser to 8181 for
testing... im looking for help, everything i try produce the same
resaults... i dont really want to bother with event machines
so, my code has a few problems, the web browser will only load a few
pages and the connection will always stay open as if the browser is
waiting for more data...
A few things:
- Better use #read and #write for your IO
- I think you are not properly implementing the HTTP proxy protocol.
- You can make your life easier by using #gets("\r\n") to read HTTP
request from client
i was thinking maybe i need 2 or 3 threads to handle both sides...
Thread.start{ receive_get from webbrowser }#step one
Thread.start{ send_get to webserver } #step two
Thread.start{ send_response to webbrowser }#step three
I don't think you'll necessarily need threads for HTTP 1.0.
if i understand, the first step i need to gather a host: field
then establish a connection to the host web server
and pass the response back to the web client...
Right.
i think my loops are wrong... maybe i can use IO to handle sockets?