http.request and raw data

Hi,
I am about to start my first program in Codea and badly need to clarify an issue that gets me started or stops my project before it begins.
Since this is a simulator connection I need outside data at a regular basis, at least 2 times pr. second.
Browsing around in the forum there is a lot of talk about sockets, but what I get from it, is that it is not be possible at all now, neither will be in future updates.

That leaves the http.request and the question if it could work that way.
My data is allways comming from another Mac computer, so I was thinking about setting up an Appache server or point to a local url file. Never tried setting up a server, so some reading up is required on my part.

Can anyone try to tell me if it is a dead end or (hopefully) help me to get started.

Maybe this could also serve for others as a list of posibilities with the http.request

Re Peter

Got it working

  1. Go to Mac (OS X Lion) Preferences/sharing and enable Web sharing. Notice the computer url, in this case 10.0.1.9
    This sets up an Apache server
  2. Locate directory Library / Webserver / Documents.
  3. Set permission to writable for the above Folder
  4. Save a txt file to the folder. In this case peterstest.txt
  5. Make a simple test Codea script with these lines

function draw()
http.request(‘http://10.0.1.9/peterstest.txt’,didGetData)
end

function didGetData(data,status,headers)
print(status…“:”…data)
end

  1. Run the script and see the txt file being read continuously.
  2. Open the txt file on the Mac and make changes. Running script updates at once.

Tadaaa…

Ok I am ready to be shot down for bad coding etc.
What do you think ?

Re Peter