Suggestion: Custom HTTP Server to Avoid Javascript Cross-Domain Restrictions

Hi Sebastien!

As I mentioned before, I’m working on measuring liver iron concentration on MRI. I’m actually thinking of a method to “bundle” my own HTML5 / Javascript web-viewer with Orthanc in the “easiest” manner so that I can distribute the app to my colleagues and let them use it “out of the box”.

At the moment, my web-viewer relies on Orthanc decoding the pixel data, and sending it through Apache / PHP to my web-viewer.

Method 1: Web-viewer served by Apache, calls on PHP which makes requests from Orthanc and sends it back to the web-viewer.
Method 2: Orthanc reverse-proxy through Apache, so Web-viewer requests Orthanc directly.

Both these methods requires installation of Apache +/- PHP.
Of course, a “packaged” system works, which is my current plan… unless:

Can Orthanc serve a local folder through it’s own HTTP server?
i.e. through configuration.json: ExternalHTTPFiles: “\external”, so that requests to “http://localhost:8042/external/” returns files from “c:\orthanc\external”

Which avoids cross-domain restrictions and I only need to ask them to install Orthanc, followed by my web-viewer HTML / JS files to \external… No Apache required…

I know that this can be implemented through modifying the source, but as you know: I know nothing about C/C++ and very little about networking, so I have no idea whether this possible feature is easy to implement and/or whether it’s going to cause a lot of network issues.

Hope that you can consider this feature in future updates (if you think it’s feasible and an acceptable idea, of course…)

Thanks in advance!


Hi Emsy,

Your proposition sounded so useful that I have just implemented it as a plugin to Orthanc :wink:

I have called this plugin “ServeFolders”. You can find its source code at the following location:

Basic usage instruction is also provided:

As you mentioned in another post that you are not comfortable with Windows compilation, you can also find precompiled binaries of the plugin on SourceForge:


Very nice.

Emys: Can you share your web viewer?


You can find an early version (August 2014) of Emsy’s viewer at the following location:

There is also Yves’ work on an Orthanc plugin that integrates its viewer DWV:



Emsy: Do you have your latest version available?


Hi Emsy:

Another suggestion is that you'd host your web viewer in github for a sample set of images, like what Dwv does:

(Highly recommend that you take some time to use github, as it truly provides a lot of resources for Open source development.)

Hi Sebastien!

Thanks for much for this plug-in! I have just got back to work after the weekend and will try it out! :slight_smile:



The early version has lots of bugs with regards to the panning and zooming (which I didn’t realize at first and attributed it to the limitations of the web browser). These are now fixed, but I’m actually waiting for this Orthanc plug-in before I re-write the data loader.

The original data-loader (with the help of PHP) works fairly well, but it’s still quite slow.

An updated version of my web viewer is at . The data-loader of the viewer hosted here is modified to read uncompressed DICOM files directly, because I wanted to push out the liver relaxometry function as soon as I could.

(And if you happen to have Leap Motion, I have a beta running at ) :wink: