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.
Photo

HttpServer V.2


  • Please log in to reply
10 replies to this topic

#1 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 01 January 2013 - 11:55 PM

Hello all,

This the HTTP server library version 2 that contains all functions that handles http web requests (GET /)(only), the server listens for connections on a separate thread hence not affecting the netduino main loop(multi task).

 

Changes from V.1:

1)Added a ServerConfig class

2)add a ServerCredential class used to authenticate and give security to the server

3)Overloaded the HttpServer constructor so that it takes a ServerCredential object

4)added an extra event named OnRequestReceived which provides the following arguments :

->IsInMemoryCard : boolean that indicates if file is MMC

->Request (byte array which is the original Request)

->FileName : requested filename extracted from the original request

5)added 2 public methods to the HttpServer class:

->send(filename) send the file from mmc

->send(byte[] data) send an array of bytes fragmented in 256 chuncks if greater that 256 bytes

7)optimized the speed

how to use the example:
1)pick a 2gb sd card and put files in it (html,pictures(jpeg,gif),flash pages(with its swf)
2)insert the sd card into netduino-plus
3)start visual studio 2010 express
4)open the example project
5)compile it and deploy to your netduino-plus board
6)open your browser and type in the ip address
7)the list of files in the sd card will appear as a link each, choose a file and it will reply with its contents.

note: you could import your own html files into sd card so that when clicked an html webpage will be displayed
note: the zipped file contains a documentation that provides help and description on the library

 

you could also visit my web page softelectrotech and download more libraries :)

watch this video demo

Attached Files



#2 Skippy

Skippy

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2013 - 07:12 AM

Hi thereI don't know how this compares to other http servers, but it works well for me. Less than a week into my Plus 2 and getting more done than I expected in a month!Thanks.

#3 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 03 January 2013 - 11:21 AM

Thanks Skippy, currently working on improving it more and more :)



#4 zmuro

zmuro

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 January 2013 - 02:00 PM

I don't know why I can't open the this project, I'm getting this error:

Unable to read the project file 'HttpLibrary.csproj'.Unable to read the project file 'HttpLibrary.csproj'.

The imported project "C:Program FilesMSBuildMicrosoft.NET Micro Frameworkv4.2CSharp.Targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.



#5 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 03 January 2013 - 02:16 PM

If you open Visual Studio first  (as administrator) and then browse to the project file, does that work? Could be an UAC issue.


"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#6 zmuro

zmuro

    New Member

  • Members
  • Pip
  • 4 posts

Posted 03 January 2013 - 02:57 PM

I tryed that already and it doesn't help...



#7 Joshua

Joshua

    Member

  • Members
  • PipPip
  • 20 posts

Posted 03 January 2013 - 08:25 PM

Does this do posts?



#8 Skippy

Skippy

    New Member

  • Members
  • Pip
  • 9 posts

Posted 03 January 2013 - 10:34 PM

I don't believe it does handle the post verb, yet. I'm pretty sure that's on the way. If not I will need that so I'll look into it when I get time!

#9 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 03 January 2013 - 10:54 PM

I will Support method soon but now im improving other things, in the next version the post method will be available



#10 skobyjay

skobyjay

    Advanced Member

  • Members
  • PipPipPip
  • 53 posts

Posted 19 January 2013 - 03:01 AM

do you have any code of how to utilize your lib? The links solution is just the lib not example project.



#11 Nart Schinackow

Nart Schinackow

    Advanced Member

  • Members
  • PipPipPip
  • 38 posts
  • LocationLondon

Posted 19 January 2013 - 11:05 AM

Hello Skobjay,

 

Yes their is an example in the zip file in the post up named httpserverv2 example,

and the video also is helpful

 

Thanks






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.