Menu

IIPMooViewer within a Django app, running dev server on port 8000

Help
Anonymous
2014-01-31
2015-11-04
  • Ruven

    Ruven - 2014-02-01

    You've set up Apache on port 80, but are trying to request iipsrv on port 8000. So either setup Apache to listen on port 8000 for iipsrv or specify explicitly the port for the server variable you pass to the client:

    var server = 'http://localhost/fcgi-bin/iipsrv.fcgi';
    
     
  • Anonymous

    Anonymous - 2014-02-06

    Ruven, if I set Apache to listen on 8000, then when I try to run the Django dev WSGI server on 8000, it gets denied, as Apache is already on that port. I have tried to set it up so like you suggested above, just pointing the server to http://localhost/fcgi-bin/iipsrv.fcgi, but then I get into cross-domain issues. I've tried setting up Apache to allow CORS, but I still keep getting the error of "Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers." from mootools-core-1.4.5-full-nocompat.js. I see from another forum post you suggest setting the load parameter. I tried that, and I get my nav window and overview image, but my main image never loads into the canvas element, and I get a waiting cursor. What exactly is the size[] part of the load parameter (couldn't find that anywhere in the docs).

    Is there a way to get around the CORS issue? Thanks.

     
  • Ruven

    Ruven - 2014-02-07

    Why don't you simply do proxy forwarding, so that all requests are handled by Apache on port 80, then dispatched to the appropriate backend?

    For iipsrv, you can proxy in this way: http://iipimage.sourceforge.net/documentation/server/#forwarding

    And you can setup something similar for your Django installation.

     
  • Anonymous

    Anonymous - 2015-11-04

    Hi Ruven and Anonymous1,

    I was facing the same problem than Anonymous1 with a node.js / express application.
    I tried a lot of differents approaches, enabling CORS in Apache, trying to use https://www.npmjs.com/package/cors

    Finally proxy-middleware made my day:
    https://www.npmjs.com/package/proxy-middleware

    var url = require('url');
    var proxy = require('proxy-middleware');
    app.use('/fcgi-bin/iipsrv.fcgi', proxy(url.parse('http://localhost/fcgi-bin/iipsrv.fcgi'));

    and wuuuupsi!

    Cheers,
    Seb

     
  • Ruven

    Ruven - 2015-11-04

    Thanks for the info. Yes, proxying is currently the most robust way of doing this as CORS support will also depend on whether the browser supports this and is not simply a question of enabling it server-side.

     

Anonymous
Anonymous

Add attachments
Cancel