Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

antrea's Content

There have been 4 items by antrea (Search limited from 17-June 23)


By content type

See this member's

Sort by                Order  

#19079 NetDuino as pachube's like webserver

Posted by antrea on 12 October 2011 - 04:41 PM in General Discussion

"I have read something on the internet" is a bad base for security considerations.



You're right, thanks for your reply... I will use the query string on my project.

Thanks again

A.



#19077 NetDuino as pachube's like webserver

Posted by antrea on 12 October 2011 - 04:00 PM in General Discussion

The methods you are outlining don't differ in safety. Why do you think the second is safer than the first?


I have read something on internet about that.

Do you think that a query string is safer as an http requests authentication?

Its more easy for me to parse a query string because i have some example in my book: http://goo.gl/XhYuG



#19073 NetDuino as pachube's like webserver

Posted by antrea on 12 October 2011 - 03:20 PM in General Discussion

I am not sure how much data you want to send per request but assuming is it only a small amount, say less than an ethernet packet of around 1500 bytes, then I would use "http get" and add the data to the query string.

such as "http://localaddress?...MyDataGoesHere"

the data itself would have to be url encoded. You would have to find or make a function to do this.

The response wouldn't have to say much just make sure it includes a http response code for success ie. 200.

you can pull the data off the query string by calling the request.Uri property and using everything after the = sign.

Then you would have to unencode the data.

I am sorry I cant give you working code, but it would look something like this:

int count = connectionSocket.Receive(bytes);
Request request = new Request(bytes);
string[] arraySplit = request.Uri.Split('=');
string data = UrlUnEncode( arraySplit[1]); //keep everything after the = sign

Hope this helps


Thanks for your reply...
Its a good idea to make a query string but.... i need to make a good and safe autentication.
I dont want to made a single query string with the username and password (maybe) like: http//localaddress?id=MyID&pass=MyPass&data=MyData...etc etc
Its unsafe...

I want to made something like that:

Client: Hi
Server: Pass?
Client: MyPass
Server: Username?
Client: MyUsername
Server: ok... good... how many data?
Client: 1
Server: Ok, tell me!
Client: 30
Server: closing
Client: Bye :)

With arduino i have used a sketch called "PachubeClient" that works exactly as above.

But... i dont have understand HOW (with which class) I can made the server's reply to an http request (not a query string).

On msdn i have read something about HttpWebRequest and HttpWebResponse for comunications between a client and server...

thanks

a.



#19037 NetDuino as pachube's like webserver

Posted by antrea on 11 October 2011 - 06:41 PM in General Discussion

Hi I have two boards: netduino and a regular arduino 2009 (with ethernet shield). I want to use arduino2009 as a client that send (via internet) data to netduino configured as a pachube's like web server. Netduino will take the data from an http request from arduino2009 and storing it on a csv file. ...but... i dont understand how netduino can take a data from an http request... Do i need to use (in netduino) httpresepone class? How? Can you help me? thanks




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.