• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[XAP] Functional Webserver

Search This thread

davux

Retired Recognized Developer
Aug 5, 2010
105
33
I've enhanced my Webserver sample to support reading from the device (where allowed), as well as reading/writing IsolatedStorage

The XAP is located in the Webserver project.

To access the webserver, open the app on your phone (it will disable the idle timer and run behind the lock screen--but WiFi will turn off, so you'll want to be connected via USB or don't let it sleep)

//phone_ip/IsolatedStorage
//phone_ip/Windows

IsolatedStorage is a special case (virtual directory that uses the SDK IsolatedStore APIs), the filesystem is mounted at the root of the webserver. Note that if you navigate to //phone_ip/, you will not see anything, as we are not able to list the contents of the root directory.

I am working to create a real socket library that mimics System.Net/.Sockets, and System.IO for file access. TcpClient and TcpListener are in a mostly functional state already.

Most of the socket and I/O code came from jmorrill. :) I have pulled code from mono to mimic System.Net.

Perhaps I'll spend some time on the web UI next, maybe a fancy Silverlight uploader. There doesn't seem to be a ton of interest though, so we'll see.

Update ("v2"):
- Authentication
- UI
- Adapter list
- More reliable
 

Attachments

  • SamsungFocusWebserver.jpg
    SamsungFocusWebserver.jpg
    57.3 KB · Views: 2,668
  • Webserver_v4.zip
    3.2 MB · Views: 5,310
Last edited:

davux

Retired Recognized Developer
Aug 5, 2010
105
33
Yeah, I think someone with a strong WM background could port code to [native, homebrew] WP7 pretty quickly. Pretty much everything works just fine.... I just wish we could add the System.Net .NET CF assemblies back to the GAC. :/
 

piaqt

Senior Member
Jan 5, 2010
313
12
New York City
I've enhanced my Webserver sample to support reading from the device (where allowed), as well as reading/writing IsolatedStorage

The XAP is located in the Webserver project.

To access the webserver, open the app on your phone (it will disable the idle timer and run behind the lock screen--but WiFi will turn off, so you'll want to be connected via USB or don't let it sleep)

//phone_ip/IsolatedStorage
//phone_ip/Windows

IsolatedStorage is a special case (virtual directory that uses the SDK IsolatedStore APIs), the filesystem is mounted at the root of the webserver. Note that if you navigate to //phone_ip/, you will not see anything, as we are not able to list the contents of the root directory.
Noob questions: It says "connect to your wifi address below". How? Also, connect the phone or the pc? And navigate via IE mobile?

As I said, noob questions. Thanks for any help.
 
Last edited:

pth6

Senior Member
Feb 23, 2009
128
27
durieux.me
I have found on alternateboot.reg
HTML:
; Disable MTPz USB function driver
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\CompositeFN]
  "ClientDriverList"=multi_sz:"Serial_Class"
What is MTPz USB function driver?
 

l3v5y

Retired Senior Moderator
Sep 13, 2007
7,485
44
29
Bristol
... which gives me the ever-popular "cannot find server or DNS address". What am I doing wrong? I assume you meant IE on my phone.

I think (might be misreading your question), you'll need to plug your device in to USB (or be prepared to loose the connection), then on your desktop, go to one of the IPs listed (in IE or any other browser).

On the screenshot shown, WiFi is the last one, with "BCMSDDHD1" attached to the label, thought the device name may be different for you. Try one that has "192.168.1." as that'll be the most likely option.
 
  • Like
Reactions: piaqt

piaqt

Senior Member
Jan 5, 2010
313
12
New York City
I think (might be misreading your question), you'll need to plug your device in to USB (or be prepared to loose the connection), then on your desktop, go to one of the IPs listed (in IE or any other browser).

On the screenshot shown, WiFi is the last one, with "BCMSDDHD1" attached to the label, thought the device name may be different for you. Try one that has "192.168.1." as that'll be the most likely option.
Thanks. Next noob question: It asks for a user/password. What do I use and or where do I set it?
 

l3v5y

Retired Senior Moderator
Sep 13, 2007
7,485
44
29
Bristol
Thanks. Next noob question: It asks for a user/password. What do I use and or where do I set it?

I don't know what the default password is, but if you type admin/admin in on the device for user/pass that works fine.

EDIT:
Code:
// In order to secure the device, the default password is a random number, not a static default

So you'll need to change it, unless you can read minds :D
 
  • Like
Reactions: piaqt

piaqt

Senior Member
Jan 5, 2010
313
12
New York City
I don't know what the default password is, but if you type admin/admin in on the device for user/pass that works fine.

EDIT:
Code:
// In order to secure the device, the default password is a random number, not a static default

So you'll need to change it, unless you can read minds :D
OK. admin/admin works. Next nq: I get "Error opening directory:O". Is there a specific path to enter?
 

obelix

Senior Member
Nov 9, 2004
58
2
this works great! does this work just over USB? I assumed that since I didnt see an SSID advertised that the webserver wasn't broadcasting over WiFi.
A few feature suggestions:
* Make it clearer in the device UI to use the last IP address. I had assumed I would use the SERIAL ON USB IP address
* When browsing files, show a detail view so that you can see date/time modfied, type (optional), size
* when in a subdirectory add an Up ellipsis (...) to more easily walk back up the directory tree.
* be able to filter a directory listing so that you can display just certain file types (ie *.exe)
* Be able to download files

I love it! Its handy to be able to get a file listing that you can copy so that you can capture file listings.
 

obelix

Senior Member
Nov 9, 2004
58
2
I found a bug. When you click on a file to download it the href seems to have an issue since the file extension is stripped. You can easily add it during the save but it would be easier to have that done by default. I need to check the syntax but for example for filebrowser.exe the html is:
<a href="/Windows/FileBrowser.exe?download=1">FileBrowser.exe</a><br />

This was handy so that it was possible to download an EXE and see what certificate is used for signing.
 

obelix

Senior Member
Nov 9, 2004
58
2
It looks like if you press Back or Start the webserver shuts down or is tombstoned.
I wonder if anyone has come up with a way to keep an application from being killed.
If that was possible then the webserver could provide active control. In that case if it was running in the background a great feature to add would be a screen capture function.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    I've enhanced my Webserver sample to support reading from the device (where allowed), as well as reading/writing IsolatedStorage

    The XAP is located in the Webserver project.

    To access the webserver, open the app on your phone (it will disable the idle timer and run behind the lock screen--but WiFi will turn off, so you'll want to be connected via USB or don't let it sleep)

    //phone_ip/IsolatedStorage
    //phone_ip/Windows

    IsolatedStorage is a special case (virtual directory that uses the SDK IsolatedStore APIs), the filesystem is mounted at the root of the webserver. Note that if you navigate to //phone_ip/, you will not see anything, as we are not able to list the contents of the root directory.

    I am working to create a real socket library that mimics System.Net/.Sockets, and System.IO for file access. TcpClient and TcpListener are in a mostly functional state already.

    Most of the socket and I/O code came from jmorrill. :) I have pulled code from mono to mimic System.Net.

    Perhaps I'll spend some time on the web UI next, maybe a fancy Silverlight uploader. There doesn't seem to be a ton of interest though, so we'll see.

    Update ("v2"):
    - Authentication
    - UI
    - Adapter list
    - More reliable
    2
    start ie and type in http://wifi address
    2
    Mango support

    Well hello there again "Webserver", i have missed you.
    Welcome to Mango!

    Thanks davux for creating the basis for the web server.
    - I am currently converting the code to be able to run under Mango ("ATL"). Its almost ready for a XDA push-out.

    Attachment for proof (Running on Omnia 7 Mango (Final)).

    Ill be releasing it today(?)
    1
    ... which gives me the ever-popular "cannot find server or DNS address". What am I doing wrong? I assume you meant IE on my phone.

    I think (might be misreading your question), you'll need to plug your device in to USB (or be prepared to loose the connection), then on your desktop, go to one of the IPs listed (in IE or any other browser).

    On the screenshot shown, WiFi is the last one, with "BCMSDDHD1" attached to the label, thought the device name may be different for you. Try one that has "192.168.1." as that'll be the most likely option.
    1
    Thanks. Next noob question: It asks for a user/password. What do I use and or where do I set it?

    I don't know what the default password is, but if you type admin/admin in on the device for user/pass that works fine.

    EDIT:
    Code:
    // In order to secure the device, the default password is a random number, not a static default

    So you'll need to change it, unless you can read minds :D