HTTP server without LUA


#1

Hy guys,

I am trying to develop an http server on a Fastrasck Supreme (i have public ip address)… it basically is a tcp server listening on port 80…

I don’t know how to handle this… For now i made the TCP server listening on port 80. When i open a connection from browser i receive a form with an username and password. I don’t know how to POST this username and password back to the server. Because in the message from browser these values aren’t included.
POST hostname/file HTTP/1.1


I looked at file system but i cannot understand if there are actually files, and i can create for example a cgi script on a separate file…the call that file and read the values form http client.

I need to make something like a dynamic web page on server wich can be accesed only with required username and password. On that web page i will store some values read from some sensors.

Hope i wasn’t too ambiguous…

thanks in advance!

EDIT :

I just saw that if i used the get method in the html form i receive url-encoded with my data.

Anyone knows how to do this in a simplified way? …not to read am write to and from the browser messages that are actual buffers in my application? I can use something from the http client part of wip to make my job easier?


#2

There are very many simple “website” examples for small microcontrollers all over the net - I suggest you get googling and study some of them!

Anything that can be done on an 8-bit microcontroller should be do-able in Open-AT!


#3

Ok awneil…It seems that i jumped right in what i knew that will work without studying other posibilities…I was actually sending an ascii buffer = “/HTTP1.1 200 Ok Content-type:text/html …” when receiving WIP_CEV_OPEN…and after that the browser asks for a password and a username …and sends back a response :
“GET GET /?name=admin&pass=asdasd HTTP/1.1 …etc” And what i wanted to do next is to read with wip_read at WIP_CEV_READ event and process somehow this information, verify the username and a password and after that serve to the browser another ascii predefined buffer with the HTML page containing the readings from sensors.

I will try to find and understand another examples…

Thanks for your reply!


#4

HTTP Tutorial:

jmarshall.com/easy/http/


#5

I studied that!

Based on that i try to make this app.

I connect to a broser to my wavecom modem… when the modem receives an WIP_CEV_OPEN event…meaning and http request like
GET HTTP/1.1
host: host:80

I send a response like
HTTP/1.1 200 OK
Content-type:text/html


After i submit a username and password…i’m receiving on the wavecom part a message like this:

GET /?user=admin&pass=password HTTP/1.1
host:host

From this i need to take the values for user and pass entered by the user and verify them with some predefined values and if it is correct i need to send another response with a html page containing my readings from a sensor.

But what i was trying to ask is if this is the correct way of doing it…or it is a simpler method besides LUA …
i dont use http service…i can use that…even if it is for the client part and customize it somehow…or i’m in the right direction…

Thank you again for your replies!.Hope i don’t bother too much.