FORUMS
Remove All Ads from XDA

HTTP Server on WM6

15 posts
Thanks Meter: 6
 
By Dinghuz, Junior Member on 14th February 2009, 03:10 PM
Post Reply Email Thread
Hi Guys!

I'd like to create a webserver on wm6 so I can contact to Localhost (127.0.0.1) to retrieve Phone info.

Purpose is a Flash app which uses GPS and Camera (Those or not accessable with actionscript)
I want the server to put GPS and Camera information on the localhost.

I know Freestyl (aka WhoNeedsAnIphone) uses a http server to pass some device variables to their flash app. But the project stopt and no code was released.

For Nokia Phone there's a Tool called KuneriLite to acces phone info with Flash.
I Also found Depeche But I don't really understand it....

Any Help/Code/App is welcome.

Jeff
 
 
14th February 2009, 05:01 PM |#2  
s.l.i's Avatar
Senior Member
Thanks Meter: 0
 
More
Hi, take a look here: http://goahead.com/products/webserver/download.aspx

I played around with it some time ago.
It has a lot of features like cgi and so on.
16th February 2009, 05:34 PM |#3  
OP Junior Member
Flag Haarlem
Thanks Meter: 6
 
More
Nice Solution....
It Works but im more into C# then C++..

Is there a C# solution for this?
All help is welcome
16th February 2009, 08:57 PM |#4  
Member
Thanks Meter: 1
 
More
Depending on how many of the HTTP verbs you really need to support (ie, do you just want to respond to a HTTP get for a certain url?) you could knock up a simple HTTP server in C# in an hour or two tops.

There's tonnes of examples of simple HTTP servers in C# on the web...
16th February 2009, 09:53 PM |#5  
OP Junior Member
Flag Haarlem
Thanks Meter: 6
 
More
Sounds good,
But i'm only able to find C# webservers for PC, not for windows mobile...

The only thing the server has to do is respond from the code, so i dont have to load actual ASP/HTML pages...

Just a listener on Localhost, if i request localhost/req?GetVar=Cam
I can do something like WriteRespone("Cam=" + SomeSysVar)
17th February 2009, 10:55 AM |#6  
Member
Thanks Meter: 1
 
More
Here you go
Attached is a C# simple http server application that I knocked up based on the MSDN sample at http://msdn.microsoft.com/en-us/library/bb397809.aspx.

I've not tested it on a phone.

The sample is for the compact framework.

Should work without any hassle.

Complete source included and the simplest parsing possible (currently responds to a http GET request for / with a chunk of HTML with "1" as the body).

Good luck, have fun.
Attached Files
File Type: zip SimpleHttpServer.zip - [Click for QR Code] (4.1 KB, 275 views)
17th February 2009, 10:57 AM |#7  
Member
Thanks Meter: 1
 
More
(Oh and I just noticed there's a confusingly commented out line that says "write response" in the source, remove / ignore it.)

You can test the windows app from a web browser by pointing at http://localhost:83
17th February 2009, 11:20 AM |#8  
nir36's Avatar
Retired Moderator
Flag Jerusalem
Thanks Meter: 332
 
More
edit:

apologies, i meant to close another thread.

17th February 2009, 12:05 PM |#9  
OP Junior Member
Flag Haarlem
Thanks Meter: 6
 
More
Thumbs up
Thnx Alot

Found this solution: http://bansky.net/blog/2007/10/compa...act-framework/

It Worked for me ;)
17th February 2009, 12:19 PM |#10  
Member
Thanks Meter: 1
 
More
That looks like a good general purpose solution

My example is tailored towards specific custom processing over HTTP rather than serving of files -> in the style of a RESTful API.

From the look of it you can do a similar thing with the Compact Web server by hooking up what the author labels a "Special file type" and adding your custom handling code in there.

[edit]

That said, you could actually edit my example to File.Open whatever was passed as a parameter off the disk and stream that back to the client, providing a more standard HTTP server without configuration.
17th February 2009, 02:18 PM |#11  
OP Junior Member
Flag Haarlem
Thanks Meter: 6
 
More
Nice simple solution u've got!
I will try to get it to work the way i want,
lookin' @ the amount of code it should be a lot faster then my previous solution.
Post Reply Subscribe to Thread

Tags
http, localhost

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes