npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

proxy-ajax

v1.0.12

Published

proxy-ajax can proxy the axaj request follow your config rules in you project

Downloads

31

Readme

proxy-ajax

proxy-ajax can proxy the axaj request follow your config rules in you project. it's easy to proxy you project to test your program. it can also be used as http proxy, if your want to proxy your iphone or android network from your conputer, you can run the proxy-ajax, and the set the http proxy in you wifi setting.

usage

npm install proxy-ajax -g
-------you can specify the config file path and port---
proxy-ajax ./.proxy-ajax.config.js -p 80

------- you can use the default config path and port---
proxy-ajax

the default config path: ./.proxy-ajax.config.js the default port: 80

config file eample:

.proxy-ajax.config.js file:
--------------------------
module.exports = {
    "port": 8889,
    //"httpsPort": 8890, 
    //"cert": "", //https cert
    //"key": "", //https key
    "target-mtop": "https://x.x.x.x/",
    "target-other": "http://baidu.com",
    "proxy": [{
        "path": "getBaidu",
        "routeTo": "target-mtop"
    }]
}

if you don't want write many config file in your project, you can also write your proxyConfig in your other config file, just like this:

xxxx.config.js file:
--------------------------
var data = require("./data")
module.exports = {
    .....
    .....
    proxyConfig:{
        
        "port": 8889,
        // "httpsPort": 8890,
        "target-page": "http://127.0.0.1:3000/",
        "target-mtop": "https://x.x.x.x/",
        "target-static": "http://127.0.0.1:8000",
        "proxy": [{
            "path": "/h5/",
            "routeTo": "target-mtop"
        },{
            "path": "/h6/",
            "routeTo": "http://xxxxx/data.json"
        },{
            "path": "/h5/jianribimai",
            "origin": "http://localhost:3000",
            "data": "./src/demo/data/new3.js"
        },{
            "path": "/h5/test",
            "data": JSON.stringify(data)
        }]
    }
    ....
}

when it runs, you will see the proxy information in the console:

client ip: ::ffff:30.7.27.202 , host: iosapps.itunes.apple.com
request URL: http://iosapps.itunes.apple.com/apple-assets-us-std-000001/Purple111/v4/f2/a1/d3/f2a

connect g-assets.daily.taobao.net:443
......

changelog

20170923 release 1.0.7

  1. add CORS config by default, if the data is mocked in local, you should specify the origin instead of *.

20170907 release 1.0.0

  1. add route to http data directly support.

20170904 release 0.0.8

  1. add https support. default cert is https://127.0.0.1 root cert, you can also generate you root cert with
node rootca.js
  1. support proxy http request to data, youcan set the data or just the data path.

20170701 release 0.0.7

  1. modify the default config file ./.proxy-ajax.config to ./.proxy-ajax.config.js, because js file is easy to extend. but youcan also use your json file by specify the config file:
proxy-ajax ./.proxy-ajax.config

LICENCE

MIT