I'm trying to have my router use Tcl to pull down a webpage from a cable modem.
Here's my code so far.
set sock [socket 192.168.100.1 80]
puts $sock "GET /signaldata.htm HTTP/1.0\n\n"
set result [ gets $sock ]
puts stdout "OUTPUT:\n$result"
set exit_msg "closing socket"
It doesn't work. All I get is:
I know the URL works because I can pull it up fine from my browser and a telnet to port 80 from the router itself also opens the socket for a brief moment.
Can anyone tell me what I'm doing wrong?