New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

freego

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

freego

Proxy for redirecting requests to targeted servers

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

FreeGo

FreeGo is a node.js http proxy for redirecting requests to different targeted servers via cookies, especially suitable for mobile hosts quick switching.

Benefits

  • Switch environment between testing server and other servers quickly.
  • Inject eruda to html page for mobile client side debugging.
  • Save whole http request for html and json response.

Installation

npm install freego --save

Usage

var freego = require('freego');

freego({
    // Configurations
    proxy: {
        freeGo: {
            pattern: /http:\/\/freego.com\//,
            target: [
                {
                    name: 'Testing',
                    ip: '127.0.0.1',
                    port: '80'
                }
                // List of servers
            ]
        }
    }
});

You need to do a little server configuration staff before using FreeGo. If you're using nginx, add rules to make sure it send requests to FreeGo if url or cookie contains "free_go_proxy". It might look like something below:

location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://$myserver;
}

location /free_go_proxy {
    proxy_set_header Host $host;
    ...
    proxy_pass http://freegoproxy;
}

map $COOKIE_free_go_proxy $myserver {
    ~* freegoproxy;
    default myserver;
}

upstream freegoproxy {
    # FreeGo server
    server 127.0.0.1:13191;
}

upstream myserver {
    server 127.0.0.1:13192;
}

After that, navigate http://xxx/free_go_proxy to enable freeGo for all pages. If a little icon appears in the right bottom corner of the page, it is successfully done.

Configurations

  • port: Server port, default to 3000.
  • logPath: Log path, also path for saving http requests.
  • ip: Ip list to allow access, see ip-filter.
  • forwardId: Add request id to url, default to false.
  • filterType: Response type to save requests, html and json only by default.
  • filter: Filters for response content processing.
  • password: Password to bypass ip filter, false to turn it off.
  • proxy: Proxy setting for different sites, see test/index.js as an example.

License

FreeGo is released under the MIT license. Please see LICENSE for full details.

Keywords

FAQs

Package last updated on 25 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc