Skip to content

Latest commit

 

History

132 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyProxy.js

Usage

Lastest Minified Extension
easyproxy.js easyproxy.min.js Easy Proxy

HTML

<script src="https://jc3213.github.io/easyproxy.js/src/easyproxy.js"></script>

TamperMonkey

// @require https://jc3213.github.io/easyproxy.js/src/easyproxy.js

Syntax

const router = new EasyProxy();

Properties

routing

  • object
  • read only
const { routing } = router;

pacScript

  • string
  • read only
const { pacScript } = router;

Method

getScript

const pacScript = router.getScript(proxy | string"");

addProxy

const result = router.addProxy(proxy | string"", rule | Array[] | null);
// true or false

removeProxy

const result = router.removeProxy(proxy | string"");
// true or false

hasProxy

const result = router.hasProxy(proxy | string"");
// true or false

findProxy

const result = router.findProxy(hostname | location.hostname | new URL().hostname | string"");
// proxy or undefined

listProxies

const proxies = router.listProxies();

addRule

const result = router.addRule(proxy | string"", rule | string"");
// true or false

removeRule

const result = router.removeRule(proxy | string"", rule | string"");
// true or false

hasRule

const result = router.hasRule(rule | string"");
// true or false

getRules

const rules = router.getRules(proxy | string"");
// Array[]
const object = router.getRules();
// Object{}

ciearRules

router.clearRules(proxy | string"" | null);
// true or false

listRules

const rules = router.listRules();
// Array[ [rules-0], [rules-1], ... ]

getScript

const pacScript = router.getScript(proxy | string"");

destroy

router.destroy();

Static Properties

pacScript

  • string
  • read only
const { pacScript } = EasyProxy;

Static Method

makeRule

const rule = EasyProxy.makeRule(hostname | location.hostname | new URL().hostname | string"");

getScript

const pacScript = EasyProxy.getScript(Array[ router | instance ]);

MatchPattern

  • example.com
    • Matches www.example.com, example.com
    • Exclude test-example.com, www.example.com.cn
Match Pattern ↓ www.youtube.com www.facebook.net x.com telegram.org
*
youtube.com
facebook.com
x.com
com
org
youtube
telegram

About

A JavaScript library built on top of MatchPattern.js, aiming to simplify proxy routing and enhance user experience.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages