Sign in to follow this  
Followers 0
Travis

HTTP server

1 post in this topic

I'm trying to write a simple basis for an HTTP server that I will be using in a future project.

So far, my host uses a simple code that will reply to an HTTP connection. However, I don't know how to send data back to the browser I am requesting data with.

TCPStartup()
$socket = TCPListen("192.168.2.2",80,10)
$data = -1
MsgBox(0,"","socket created")
Do
    $data = TCPAccept($socket)
Until $data <> -1
MsgBox(0,"","connected!")
While 1
    $data1 = TCPRecv($data,9999)
    If @error then ExitLoop
    If $data1 <> "" and StringInStr($data1,"GET") = 1 then ;eventually it will only reply to specific requests
        MsgBox(0,"RECEIVED TRANSMISSION",$data1)
    EndIf
WEnd

How simple is it to implement a response?

Thank you in advance :)

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0