Code Monkey home page Code Monkey logo

json-proxy's People

Contributors

chrisroush avatar coldu avatar ehtb avatar graemef avatar guyellis avatar joshuajabbour avatar steve-jansen avatar vages avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

json-proxy's Issues

How to trim leading directory

Example:

// in Gruntfile.js
//...
require('json-proxy').initialize({
  proxy: {
    forward: {
      '/remote-api/': 'https://api.company-a.biz:443'
    }
  }
}),
//...

Problem:
The actual API URL is something like https://api.company-a.biz/object-name/:id but I want to experiment with it locally as http://my-test-site.local/remote-api/object-name/:id. However, it appears that json-proxy is converting that to https://api.company-a.biz/remote-api/object-name/:id. It would be nice to exclude the folder I'm putting in my Gruntfile. Additionally, I need to do this for a few different remote API, so I'd like an easy way to namespace them with folders. Eventually my backend will sort this out but json-proxy is meant for our early prototyping phase.

Is there a way to do that? The docs don't make this clear and I couldn't immediately tell by digging into the code -- although it looks like it just uses the full path. In my particular case the remote API doesn't hide behind a root folder so I'd have to make several separate json-proxy routes in my Gruntfile.js to make it work.

Can't install json-proxy when using Nexus NPM

With last versions of json-proxy, we can't install json-proxy with a Nexus NPM.

I think the problem comes from the resolved attribute in each dependency of npm-shrinkwrap.json file. Dependencies are retrieved using the url defined in resolved attribute instead of using our Nexus url.

The npm doesn't install dependencies - getting error for 'express'

Hi

I just installed node and then used 'npm install -g json-proxy' to install node modules and dependencies globally for json-proxy. But after this the json-proxy did not start as expected. I got error for module 'express'. After this I installed 'express' node module but getting new error now as shown below:

C:\Users\user>json-proxy

C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:295
    temp = pair.split('=');
                ^
TypeError: Cannot call method 'split' of undefined
    at tokenize (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:295:17)
    at parseHeaderRule (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:241:13)
    at C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:186:18
    at parseCommandLineArgument (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:217:10)
    at parseCommandLine (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:185:5)
    at configParser (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\config.js:19:12)
    at Object.run (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\lib\cli.js:16:16)
    at Object.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\json-proxy\bin\json-proxy:32:26)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

Using latest version of node.js --> v0.10.29

Digest auth header

Hi Steve,
Thanks for writing this plugin-- my API doesn't have CORS or JSONP enabled so its really really helpful. Is there a way I can perform digest authentication with the headers function? I need to get back the realm and nonce of the initial header response and send another header with the encrypted values. Let me know if you have any ideas.
Thanks!
Jen

Not working with current http-proxy module

Doesn't seem to work OOTB (at least for me) because the shrinkwrap file lists a 0.10 version of http-proxy which means installing it will pick up a version which is not compatible (see https://github.com/nodejitsu/node-http-proxy/blob/caronte/UPGRADING.md). The last version of http-proxy looks like it would be 0.8.7, so the shrinkwrap should not list 0.10.

The problem is at https://github.com/steve-jansen/json-proxy/blob/master/npm-shrinkwrap.json#L105 - not sure what you would want to do about the shrinkwrap though; presumably it's there for a reason.

Another problem is that the deps list ">=0.8.7" which means all later versions will be used.

Forward proxy settings for json-proxy users behind a corporate proxy server

From: Adi *******@gmail.com
Date: March 12, 2013 6:39:38 AM EDT

Hi Jansen,
As you're the inventor of json-proxy, i need to ask whether json-proxy can forward the request to proxy and please explain how to do that.
My case is, my web server (which i run the json-proxy) is behind a proxy, so when the user (without any connection to internet) request the access to google jsapi, the web server should forward the request to the proxy.
Client --> web server (json-proxy) --> proxy server --> internet.
I'm a newbie in the jsapi things,
Thanks for the help,
Rgds,
Adi

Bug in grunt-express config example?

I tried to use json-proxy in Grunt as described in the README:

livereload: {
    options: {
        middleware: function (connect) {
            return [
                    require('json-proxy').initialize({ file: './myconfig.json' }), // <-- here
                lrSnippet,
                mountFolder(connect, '.tmp'),
                mountFolder(connect, yeomanConfig.app)
            ];
        }
    }
}

This does did not work for me but when I changed it as follows it worked:

livereload: {
    options: {
        middleware:  [
                    require('json-proxy').initialize({ file: './myconfig.json' }), // <-- here
                lrSnippet,
                mountFolder(connect, '.tmp'),
                mountFolder(connect, yeomanConfig.app)
        ];
    }
}

I.e. it seems middleware needs to be a array rather than a function. Looking at the source code of grunt-express shows that grunt-express expects this property to be an array. Am I missing something or is the example wrong indeed?

Proxy Forward Request Headers

Is there a way for the json-proxy module to forward request headers as well. Right now I see there is only a way to set request headers at the configuration level.

But if I was to send a POST request to localhost:9000/api with Service-End-Point = http://google.com as the header, will the json-proxy module forward that header to the forwarding url.

Update shrinkwrapped modules

Morgan is not included in shrinkwrapped modules, so by default you get Error: Cannot find module 'morgan' when installing this package.

Matching absolute paths sometimes

Is there a way that I can match an absolute path but not what comes after it?

For example, I want the proxy to forward for /api/search but not for /api/search_all

i.e. if it sees /api/search it does the forward. If it sees /api/search_all it calls next().

High sev vulnerability caused by outdated express version

Outdated version (4.14.0) of express contains dependencies with high severity vulnerabilities:

โœ— High severity vulnerability found in qs
  Description: Prototype Override Protection Bypass
  From: [email protected] > [email protected] > [email protected]

โœ— High severity vulnerability found in fresh
  Description: Regular Expression Denial of Service (ReDoS)
  From: [email protected] > [email protected] > [email protected]
  From: [email protected] > [email protected] > [email protected] > [email protected]
  From: [email protected] > [email protected] > [email protected] > [email protected] > [email protected]

json-proxy -c command not reading config

When trying to start the json-proxy and using the command json-proxy -c "C:/Users/ms7705/git/config/json_proxy.conf.json" The proxy starts without using the attributes set in the json_proxy_conf.json file.

This command format worked before we installed json-proxy last night. I noticed that there was a release of json-proxy 14 days ago. Was there an enhancement that would have changed the way a config file should be indicated when starting json-proxy?

Thanks for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.