HTTP Proxy for Mojito application?

I have a Mojito application and an Apache application. I want to proxy some paths from the Mojito application to the Apache application. I want to use http-proxy, but I do not know in which file to start the proxy server. In Express, it would be app.js. My code for creating a proxy looks like this:

  var http = require('http'),
      httpProxy = require('http-proxy');
    hostnameOnly: true,
    router: {
      'localhost:8001': 'localhost:8666',
      'localhost:8001/path': 'localhost:8080'

Which file should I put this code in? Is this the best way to do this? Does Mojito have its own way of proxying?

1 Reply
  • Hi,

    Mojito doesn't have a way of doing proxying.  What you might want to do is instead have apache be the main webserver and setup proxies in it to proxy certain parts of your site to the Mojito server.



Recent Posts

in Yahoo! Mojito