Jump to content

HTTP server


Recommended Posts

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 :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...