[XAP][Source] Root Webserver - v2.3.1 (supports Full or Root Tools unlock)

Search This thread

NebZoNe

Senior Member
Mar 21, 2011
379
67
Paris (suburbs)
soundcloud.com
I love that webserver app, features & design : perfect!
When going to see friends laughing at my wp7 because it's well-known it can't act as an ext-drive...
Just plug my cable and run web app...then i'm laughing tooo
Much more usable than wmdc launcher because no need to install any particular soft.
Hope it will meet some improvement in near future!!!
Just keep it up GoodDay2Die!!!
 

voluptuary

Senior Member
Dec 29, 2010
960
753
Mukwonago
Hey GDTD would you mind if I include this in my Focus ROM? I would give you credit of course on the ROM page. Either way thanks for your work.


Edit: Also wanted to say I might edit it to make it look more "microsofty" to match the whole stock feel of the ROM.
 
Last edited:

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
You are quire welcome to do so, both to include it and to edit it. If you want to post an edited version here, that would be cool, too. @jayjojayson has been doing a great job of Metro-izing the UI of the web pages (something I never put much effort into).
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
Wow, fantastic work! Thanks for your great contributions. I'm going to make the next version use templates for more pages (for example, the folder listing pages). I'm also going to try correcting the server's tendency to send the pages as UTF-8 without telling the browser that it's doing so. Combined, these should fix some persistent issues as well as letting you tweak the look of other pages more easily (without recompiling any C#).

A word of warning about using two browser sessions at once: Although the webserver is multi-threaded, I can't guarantee how thread-safe it is right now. You could possibly have race conditions (for example, if one session tried to upload a file to the phone while another tried to delete the folder it was in) that may lead to unexpected behavior or crashes. That said, I've tested it with basic multi-client operation and it does work (although it's limited to handling only a few clients simultaneously, to keep resource usage down).
 

jayjojayson

Senior Member
Wow, fantastic work! Thanks for your great contributions. I'm going to make the next version use templates for more pages (for example, the folder listing pages).

that's sound really good. it would be great to edit the folder listing pages. then i can make a design, with black background in folders and so the htc hd7 design will look like the original design.

I'm also going to try correcting the server's tendency to send the pages as UTF-8 without telling the browser that it's doing so. Combined, these should fix some persistent issues as well as letting you tweak the look of other pages more easily (without recompiling any C#).

great, maybe the bugs with internetexplorer go away with this settings.

A word of warning about using two browser sessions at once: Although the webserver is multi-threaded, I can't guarantee how thread-safe it is right now. You could possibly have race conditions (for example, if one session tried to upload a file to the phone while another tried to delete the folder it was in) that may lead to unexpected behavior or crashes. That said, I've tested it with basic multi-client operation and it does work (although it's limited to handling only a few clients simultaneously, to keep resource usage down).

let's do us make further tests, then we can create a design for example, with two file explorer in one window (not in two, as it is now). this would be cool, if you can search in different directorys or subdirectorys in only one window.
if there are is a solution, that we can copy files from one to a other directory, build it in please.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
File copy or move *can* be implemented using a cookie to track the pending operation. It's one of the features I want to add, but I think it will wait until v2.5 at least, when I also plan to add more UI for dealing with files (access all their timestamps, easily change all their attributes, view and optionally edit them in-place, etc.). Since copy/move can already be managed by downloading the file and re-uploadin it elsewhere (although this doesn't work with Mobile IE), it's lower-priority for now.
 
  • Like
Reactions: jayjojayson

LiFePo4

Senior Member
Aug 19, 2011
336
53
Oregon
GDTD - I just installed this and set it to elevated privilege with Root Tools and it works. Why this is important is I failed the HTC Utility driver test before elevating it (and it of course did not run). I note your first post still says you need to pass this test or have a custom ROM, but elevating it works in my case.

P.S. This is how I got and put back the download limit modified xml files for the other email thread and then set them to read only.
 
  • Like
Reactions: GoodDayToDie

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
Ack sorry, I thought I'd updated the first post here in light of WP7 Root Tools but apparently not. I'll do that now, thanks!
 

inspectoralex

Member
Jun 13, 2009
5
1
Out of memory problem

If I try to download a big file (about 500mb) from my phone and I get an error page :
HTML:
WP7 WebServer - ERROR An exception has occurred! You may have tried to access a location that doesn't exist, or that can't be opened. The error message is: System.OutOfMemoryException: OutOfMemoryException at System.IO.BinaryReader.ReadBytes(Int32 count) at Homebrew.IO.File.ReadAllBytes(String filename) at WebServer.Handler.Process(RequestContext context) at HttpServer.Server.ProcessModules(RequestContext context) at HttpServer.Server.HandleRequest(RequestEventArgs e) at HttpServer.Server.OnRequest(Object sender, RequestEventArgs e) at HttpServer.HttpListener.OnRequest(Object sender, RequestEventArgs e) at HttpServer.HttpContext.OnRequest(Object sender, FactoryRequestEventArgs e) at HttpServer.Messages.MessageFactoryContext.OnMessageComplete(Object sender, EventArgs e) at HttpServer.Messages.Parser.HttpParser.OnComplete() at HttpServer.Messages.Parser.HttpParser.GetHeaderName() at HttpServer.Messages.Parser.HttpParser.Parse(Byte[] buffer, Int32 offset, Int32 count) at HttpServer.Messages.MessageFactoryContext.Parse(Byte[] buffer, Int32 offset, Int32 length) at HttpServer.HttpContext.ParseBuffer(Int32 bytesLeft) at HttpServer.HttpContext.OnReceive(Int32 bytesLeft) at HttpServer.HttpContext.b__a() at System.Threading.ThreadHelper.ThreadStartHelper(ThreadHelper t) at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStartHelper()
If you have time, can you fix it?
 

hitmanhell25

Member
Mar 8, 2012
26
0
webserver was working correctly 1st time
I installed it and mark trusted inwp7rootools.
then I removed it and again installed it after few days,and its
not working any more. it runs and when I open the ip indicated it doesn't work
..it is marked trusted also.
 

GoodDayToDie

Inactive Recognized Developer
Jan 20, 2011
6,066
2,933
Seattle
@hitmanhell25: Sorry for the long-delayed response. Have you tried removing the "Trusted" mark in Root Tools and adding it again?

If that's not it, you're going to have to be more specific about the problem. Are you able to connect to the server (i.e. does the browser find the server or does it say something like "the address cannot be found")? Do you get the password prompt? Does the browser connect to the server but get no response? What is the name of the connection (on the phone's screen) that you're using? Are you using the same WiFi network as before (some networks don't permit one device to talk directly to another device; this breaks the way the server works)?
@inspectoralex: At *some* point I do plan to implement Chunked data encoding (a form of HTTP transmission that supports large files more easily) or at least handle read-send looping over the file (rather than trying to read the entire thing for a single send). Neither of these are terribly hard, I've just been distracted by other things.

But yes, if you try to upload or download a file that's more than perhaps 50% of your phone's memory (so, 250MB for most WP7 devices) it will likely fail with that error. It may even fail on smaller files. I'll put that fix in the to-do list for once I (metaphorically) get off my but and begin releasing updates to this app again.

A quick note for any WP8 users: Although this app doesn't work on WP8, I've got a new and completely re-implemented version available for WP8. It doesn't (yet) have anything close to full access - it's more akin to fiinix's Mango webserver, but for WP8 - but it does work for some things.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 25
    UPDATE: Still working on a newer version of the webserver, but I've been distrcted by a number of other projects lately (including getting a new job). The most important news is that the Root Webserver works great with WP7 Root Tools; you don't need a full-unlocked ROM or HtcRoot compatibility anymore! Just mark the app as Trusted in the WP7 Root Tools policy pivot, and you're good to go.

    Sorry for the long delay, I've been working on many different things. One of them is re-write of a substantial part of this app, to make it more modular and extensible and also to add more features. That re-write is far from done, any may end up being broken into a few smaller pieces once any of the new or re-written features reach release-quality without the whole app being unusably broken.

    This project started out as a child of the HtcRoot project. It no longer requires HtcRoot; full-unlock or WP7 Root Tools work fine. It's also a child of the Functional Webserver / WebServer (Mango) projects, and builds on their open-source foundations. Its goal is to allow unfettered access to your phone through the convenience of a web browser.

    Fifth release (v2.3.1)
    Platform release, minor feature release, minor library update, bugfixes
    Should now be compatible with fully unlocked custom ROMs, even if they can't use the HtcRoot project.
    This release does not include NativeIO_Mango source, as it was not changed. If you need the source for this library, extract it from the 2.2.0 download.

    Homebrew library (v1.6.3)
    Better detection and reporting of exceptions due to not being root.
    Should be safe to use the HtcRoot functionality on fully-unlocked ROMs.

    Please see the changelog in the app for details and history

    Note that this app requires a slight update to NativeIO_Mango from @fiinix's version. There were some bugs in the library that were making things difficult, so I fixed them. I also changed the return values of a couple functions (though the signatures are unchanged) to give the ability to return error codes from COM. Source code for both the managed Homebrew and COM NativeIO_Mango libraries is included, along with compiled binaries. Source code for the HtcUtility library can be downloaded from the HtcRoot proect.

    Features:
    View folder and ROM Module last-modified dates. (NEW 2.3.1)
    File attribute info now presented better. (NEW 2.3.1)
    Upload files anywhere. (2.2.0)
    Create and delete directories anywhere. (2.2.0)
    Delete writable files.
    Add or Remove readonly attribute from files. (2.2.0)
    See file size and attributes for any file.
    Browse the entire filesystem.
    Download any file (still not ROM modules, though).
    Static HTML files in a "Content" folder for easier editing.
    Easy link to browse (and add your own files) to Content folder (2.2.0)
    All features of previous WebServer versions (IsoStore uploading, authentication, etc.)
    Changelog

    Bugfixes:
    Fixed a case where setting file attributes or uploading a file would fail due to lacking permissions.
    Fixed the potential for infinite loops on fully-unlocked ROMs compatibel with the HtcRoot project.
    More effort to eliminate RootException / Error 1260.

    Upcoming:
    Access the registry as well as the filesystem.
    Better access to installed application info and folders.
    View, edit, move, and rename files.
    Rename and move directories.
    Server-side commands (process provxml, for example)?
    Filesystem/Registry/Application search?

    Known Bugs:
    App may take several seconds to close; don't re-launch it immediately or weird things may happen.
    Touching the screen while the app is in "root" mode appears to cause a crash, and posible resource leak.
    Error 1260 (Least Privileged Chamber) may still occasionally appear on first access attempt or two... really wish I knew why.

    Requirements:
    Developer-unlocked phone (if you remove ID_CAP_INTEROPSERVICES it will work without root access, cutting off most of the filesystem).
    For root access, you need *EITHER*
    * A fully-unlocked ROM
    * An interop-unlocked HTC phone with working HtcUtility driver
    If your phone is compatible with the HtcRoot project, you're OK.

    Thanks To:
    Davux (original author of the "Functional Webserver" app)
    Fiinix (Ported the NativeIO library and Webserver app to Mango)
    MarysFetus (designed icons and graphics for the webserver app - site http://klaus-widraw.de)
    Everybody who helped make the HtcRoot project possible.


    Have fun!
    7
    Metro HTML-design for HtcRootWebServer

    First of all, i want thank GoodDayToDie for developing this xap.
    it's really nice and simple to use. the filesystem/explorer is really much faster than touchexperience or touchexplorer. moreover now you have access to your device at any time and anywhere. for example, you can use your device as external storage, like a usb-stick.

    You only need the xap, deploy it to your device, choose name and password and connect via internetbrowser to the ip is showing in app.

    Secondly i write new html-files for the index-site and all other sites, that you can change in content folder or easily install the xap. I think this is important to get a nice design and simple using of the app. :rolleyes:

    What is to do!
    method a)
    Download the rar-file and extract it to a folder of your choice! than connect to your device, choose the content folder in web-browser and delete the included files index.htm, about.htm, changelog.htm and error.htm. after that you have to upload the files in the attached rar-file directly. (important is to delete first and upload after) if you get a error at upload, restart the app, refresh the browser and try it again.

    method b)
    Easily install the created xap.
    I have only change the files in content folder, no other files!
    Now, you can change the backgroundimage (htchd7.jpg) in content folder.
    But notice, if you upload/change your image, it must be 1000x1000pixel and named htchd7.jpg

    I have test it with my Htc HD7 (nextgen+ 2.6, nextgen+ 3.0, intrinsic) and with Htc Mozart (dft v3). Both works fine with firefox, google chrome, safari and InternetExplorer. With InternetExplorer you get some designbugs that i don't know why. (ver_1.1 fixed the bugs, works with IneternetExplorer now)

    With the new xx.htm- or xap-files you will get a better design. :)

    a) rar-files
    ver_0
    - support Firefox, Google Chrome and Safari
    - backgroundimage HTC included
    ver_1.1
    - support Internet Explorer and also Firefox, Google Chrome & Safari
    - backgroundimage HTC included
    - correct some bugs in html-code

    b) xap-files
    ver_231_Design_01
    - support Firefox, Google Chrome, Safari and also Internet Explorer
    - metro design
    - html-files included in xap
    - slightly modified backgroundimage HTC
    - backgroundimage (1000x1000pixel) can be changed now

    ver_231_Design_02
    - completely restructured HTML-Code
    - support all browser like MF, GC, S, IE
    - metro design
    - html-files included in xap
    - backgroundimage (1000x1000pixel) can be changed now
    - css-file inside img-folder can be edit, if you want
    - possibility to change the livetile color to gray (HTC HD7 theme)
    - possibility to change the theme

    ver_231_Design_03
    - update the LiveTile and Splashscreen
    - possibility to open second browser window
    - possibility to make notes in current session
    - otherwise the same version like design_02
    - support wp root tools (install root tools and the webserver app will work)

    - with the second brower window you can upload two files at the same time. i test it with my hd7 and i was able to upload two files simultaneously.
    - notes are prepared for the next update, then registry editing can be easily changed.


    Sorry, my english is not the best one, but i hope you understand what i mean and think about. great project, looking forwards for updates hopefully with registry access! :)
    4
    After a long delay, version 2.3.1 is out. The major new thing is that it should now run on fully-unlocked custom ROMs, and will probably work if elevated using WP7 Root Tools v0.9 or later as well!

    This is really just an interim release. It has some minor feature improvements and bugfixes, but is not the big re-write I've been working on. However, with the advent of custom ROMs for Samsung and for gen1.5 HTC phones, I felt it was important release this version now. This is even more important with the (presumably) imminent release of WP7 Root Tools v0.9, which will allow elevating other apps (different from the way that HtcRoot elevates them, but with similar effect). Since it was relatively simple to make the neccessary changes to run on such ROMs, I chose to do so prior to the next major release.
    2
    2
    I'm looking into ways to resolve the read error issue. Once it decides to work, I can leave the app running for hours (on USB power, idle detection disabled of course) and browse with no trouble, but when I first open the app it's ornery for a few minutes. Very weird (and annoying). I'm guessing it's due to a threading issue, which would technically be a bug in the HtcRoot library, but I'll need to explore more.

    By the way, the Windows folder takes a moment to load (it's huge). It should work pretty reliably though (you can open it for reading without having root at all, actually) and it opens a lot faster on my version than it did on the earlier ones (StringBuilder + half as many FileSystem calls + eliminated one of the slowest calls).

    @Ttblondey: Dude, it's a W E B S E R V E R app. It runs a web server on your phone. You browse it through a web browser. I literally don't know what else to tell you, except to go read the threads on the other web server apps.