Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Net commands, and websites
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jrblast




PostPosted: Wed May 09, 2007 7:52 pm   Post subject: Net commands, and websites

I've been experimenting with turings Net module lately, and decided to try making a proxy server (Users connect to my computer, then I send them the code that the url generates). The problem is I'm having trouble accessing web sites. I tried using the Net.OpenURLConnection, but that kept crashing turing. So I decided to try a regular connection on port 80. I realize that websites use HTTP which involves the client first sending some information including the path (which is why i have the put : netStream, "GET"... line) but it just says waiting for keyboard input. The IP there is my own, I'm running apache right now so I can test it and my friend says hes getting the same error.
Turing:
var data : char
var netStream := Net.OpenConnection ("99.245.168.25", 80) %Open connection
put : netStream, "GET / HTTP/1.0"   %Tell the server to access the path '/'
if netStream > 0 then   %Ensure a proper connection
    loop            %Get everything
        get : netStream, data
        put data ..
        exit when eof (netStream)
    end loop
end if
Sponsor
Sponsor
Sponsor
sponsor
LaZ3R




PostPosted: Thu May 10, 2007 4:10 pm   Post subject: Re: Net commands, and websites

Yeah... I think part of the problem in there is that the user is trying to get data from your computer which isn't sending anything back.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: