proxyverity-widget 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +160 -2
- package/index.js +126 -0
- package/package.json +41 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 ProxyVerity
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,161 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ProxyVerity Proxy Checker Widget
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An embeddable proxy checker: one `<script>` tag puts a working checker on your
|
|
4
|
+
page. Your visitors paste proxies, we check them on our side, and the results
|
|
5
|
+
open on a page they can bookmark or share. Free, no account, and nothing to
|
|
6
|
+
install on your server.
|
|
7
|
+
|
|
8
|
+
**Build your snippet:** <https://proxyverity.github.io/Proxy-Checker-Widget/>
|
|
9
|
+
— pick the theme and colours, see the real widget change as you do, copy the
|
|
10
|
+
tag.
|
|
11
|
+
|
|
12
|
+
**Reference documentation:** <https://proxyverity.com/proxy-checker-widget/>
|
|
13
|
+
**Hosted checker:** <https://proxyverity.com/proxy-checker/>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<script src="https://api.proxyverity.com/widget/embed.js"
|
|
21
|
+
async
|
|
22
|
+
data-width="100%"
|
|
23
|
+
data-height="520"
|
|
24
|
+
data-theme="light"></script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The widget appears where the tag is, followed by a short credit line. That
|
|
28
|
+
line is the condition of use — see below.
|
|
29
|
+
|
|
30
|
+
## Install from a package registry
|
|
31
|
+
|
|
32
|
+
The tag above is all you need — these packages only build it for you and
|
|
33
|
+
contain no copy of the loader. The checker always runs from
|
|
34
|
+
`api.proxyverity.com`, so a fix on our side reaches you without a release
|
|
35
|
+
here.
|
|
36
|
+
|
|
37
|
+
### npm
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
npm install proxyverity-widget
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
import { mount } from 'proxyverity-widget';
|
|
45
|
+
|
|
46
|
+
mount('#checker', { theme: 'auto', accent: '#ff6600', radius: 12 });
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`createEmbedScript(options)` returns the element without inserting it, and
|
|
50
|
+
`embedTag(options)` returns the snippet as a string for server-side rendering.
|
|
51
|
+
|
|
52
|
+
### Composer
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
composer require proxyverity/proxy-checker-widget
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
```php
|
|
59
|
+
use ProxyVerity\Widget\Embed;
|
|
60
|
+
|
|
61
|
+
echo Embed::tag(['theme' => 'auto', 'accent' => '#ff6600', 'radius' => 12]);
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Option names are the camelCase form of the attributes in [Options](#options):
|
|
65
|
+
`chunkSize` for `data-chunk-size`, and so on. Unknown keys are ignored rather
|
|
66
|
+
than rendered. Values are passed through and validated on our side, where an
|
|
67
|
+
invalid one falls back to the theme's default.
|
|
68
|
+
|
|
69
|
+
Both packages are MIT-licensed. The credit line described below is a condition
|
|
70
|
+
of using the hosted widget, not of using this code.
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## The credit line
|
|
74
|
+
|
|
75
|
+
The widget adds this underneath itself, in your page:
|
|
76
|
+
|
|
77
|
+
> Proxy checker by [ProxyVerity](https://proxyverity.com/)
|
|
78
|
+
|
|
79
|
+
**Keeping it visible is the condition of use.** The widget is free and the
|
|
80
|
+
credit is what it costs. It is a plain line of text with a plain link, and it
|
|
81
|
+
inherits your page's colour and typeface, so it reads as part of your design
|
|
82
|
+
rather than a sticker on top of it. `data-credit` and `data-credit-align` move
|
|
83
|
+
it where you want it.
|
|
84
|
+
|
|
85
|
+
What you may not do is hide it, shrink it below legibility, or make it
|
|
86
|
+
transparent. You could, in two lines of CSS — we are asking, not preventing.
|
|
87
|
+
It is also what Google expects of an attribution link, so a hidden one is a
|
|
88
|
+
problem for both of us.
|
|
89
|
+
|
|
90
|
+
The credit's text and destination are not configurable, and will not become
|
|
91
|
+
configurable.
|
|
92
|
+
|
|
93
|
+
## Options
|
|
94
|
+
|
|
95
|
+
| Attribute | Values | Default | Effect |
|
|
96
|
+
|---|---|---|---|
|
|
97
|
+
| `data-width` | any CSS width; a bare number means px | `100%` | container width |
|
|
98
|
+
| `data-height` | px or percent | `520` | starting height; the widget then resizes itself |
|
|
99
|
+
| `data-theme` | `light`, `dark`, `auto` | `light` | `auto` follows the visitor's OS setting |
|
|
100
|
+
| `data-accent` | `#rgb`, `#rrggbb` | `#2563eb` | button and links |
|
|
101
|
+
| `data-bg` | `#rgb`, `#rrggbb`, `transparent` | theme's | background |
|
|
102
|
+
| `data-fg` | `#rgb`, `#rrggbb` | theme's | main text |
|
|
103
|
+
| `data-border` | `#rgb`, `#rrggbb` | theme's | field and panel borders |
|
|
104
|
+
| `data-radius` | `0`–`24` | `6` | corner radius in px |
|
|
105
|
+
| `data-font` | `system`, `sans`, `serif`, `mono` | `sans` | typeface |
|
|
106
|
+
| `data-threshold` | integer | `50` | lists this size or smaller go in one request |
|
|
107
|
+
| `data-chunk-size` | integer | `50` | proxies per request for longer lists |
|
|
108
|
+
| `data-open-results` | `1`, `0` | `0` | `1` opens the results page in a new tab |
|
|
109
|
+
| `data-credit` | `below`, `above` | `below` | which side of the widget the credit sits on |
|
|
110
|
+
| `data-credit-align` | `left`, `center`, `right` | `left` | credit alignment |
|
|
111
|
+
|
|
112
|
+
Colours must be hex — `#ff8800` or `#f80`. Named colours and `rgb()` are not
|
|
113
|
+
accepted, and anything unreadable is replaced by the theme's own value, so a
|
|
114
|
+
typo leaves you with a working widget rather than a broken one.
|
|
115
|
+
|
|
116
|
+
`data-font` defaults to `sans` (Arial), which is what the widget has always
|
|
117
|
+
used. `system` uses the visitor's own interface font and usually blends in
|
|
118
|
+
better; it is recommended for new embeds rather than imposed on existing ones.
|
|
119
|
+
|
|
120
|
+
## Matching a design
|
|
121
|
+
|
|
122
|
+
The widget runs in an iframe, so your stylesheet cannot reach inside it —
|
|
123
|
+
these attributes are how your styling gets in.
|
|
124
|
+
|
|
125
|
+
```html
|
|
126
|
+
<script src="https://api.proxyverity.com/widget/embed.js"
|
|
127
|
+
async
|
|
128
|
+
data-theme="auto"
|
|
129
|
+
data-accent="#ff8800"
|
|
130
|
+
data-bg="transparent"
|
|
131
|
+
data-radius="14"
|
|
132
|
+
data-font="system"></script>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`data-bg="transparent"` lets your page show through instead of a white panel
|
|
136
|
+
sitting on it, which usually looks best on a coloured or patterned background.
|
|
137
|
+
|
|
138
|
+
Two things look after themselves: `data-theme="auto"` follows the visitor's
|
|
139
|
+
light or dark system setting, and the button's label colour is computed from
|
|
140
|
+
your accent, so a pale accent gets dark text instead of unreadable white.
|
|
141
|
+
|
|
142
|
+
## How it works
|
|
143
|
+
|
|
144
|
+
1. The tag loads a small loader script, which inserts a sandboxed iframe plus
|
|
145
|
+
the credit line.
|
|
146
|
+
2. Visitors enter proxies as `IP:Port`, optionally with a protocol prefix.
|
|
147
|
+
Lists of `data-threshold` or fewer go in one request; longer ones are sent
|
|
148
|
+
in batches of `data-chunk-size`, about one a second, with progress shown.
|
|
149
|
+
3. Checking happens on our servers, so your visitors' browsers never connect
|
|
150
|
+
to the proxies they are testing.
|
|
151
|
+
4. Results open on `/result.php?hash=…`, which has its own address. The widget
|
|
152
|
+
does not render results row by row.
|
|
153
|
+
5. The iframe reports only its own height back to your page, over
|
|
154
|
+
`postMessage`. Your page sends it nothing and never handles the proxy data.
|
|
155
|
+
|
|
156
|
+
If a visitor goes faster than the service allows they see a short wait message
|
|
157
|
+
and the widget retries by itself.
|
|
158
|
+
|
|
159
|
+
## Support
|
|
160
|
+
|
|
161
|
+
Questions and problems: <https://proxyverity.com/>
|
package/index.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* proxyverity-widget — a thin wrapper around the hosted ProxyVerity proxy
|
|
3
|
+
* checker widget.
|
|
4
|
+
*
|
|
5
|
+
* This package contains no checking logic and no copy of the loader. It builds
|
|
6
|
+
* the same <script> tag you would paste by hand and lets the hosted loader at
|
|
7
|
+
* api.proxyverity.com do the rest, so a change on our side reaches you without
|
|
8
|
+
* a release on yours.
|
|
9
|
+
*
|
|
10
|
+
* Docs: https://proxyverity.com/proxy-checker-widget/
|
|
11
|
+
* Snippet builder: https://proxyverity.github.io/Proxy-Checker-Widget/
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** URL of the hosted loader. */
|
|
15
|
+
export const EMBED_SRC = 'https://api.proxyverity.com/widget/embed.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Option name -> data attribute. Anything not listed here is ignored, so a
|
|
19
|
+
* typo cannot silently become an attribute the loader does not understand.
|
|
20
|
+
*
|
|
21
|
+
* The credit's anchor text and destination are deliberately absent: they are
|
|
22
|
+
* fixed in the loader and are not configurable here or anywhere else.
|
|
23
|
+
*/
|
|
24
|
+
const ATTRIBUTES = {
|
|
25
|
+
width: 'data-width',
|
|
26
|
+
height: 'data-height',
|
|
27
|
+
theme: 'data-theme',
|
|
28
|
+
accent: 'data-accent',
|
|
29
|
+
bg: 'data-bg',
|
|
30
|
+
fg: 'data-fg',
|
|
31
|
+
border: 'data-border',
|
|
32
|
+
radius: 'data-radius',
|
|
33
|
+
font: 'data-font',
|
|
34
|
+
threshold: 'data-threshold',
|
|
35
|
+
chunkSize: 'data-chunk-size',
|
|
36
|
+
openResults: 'data-open-results',
|
|
37
|
+
credit: 'data-credit',
|
|
38
|
+
creditAlign: 'data-credit-align',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Values are passed through untouched. They are validated server-side, where
|
|
43
|
+
* an invalid one falls back to the theme's default without an error. Checking
|
|
44
|
+
* them again here would mean two sets of rules that can disagree.
|
|
45
|
+
*/
|
|
46
|
+
function applyOptions(script, options) {
|
|
47
|
+
for (const [key, attribute] of Object.entries(ATTRIBUTES)) {
|
|
48
|
+
const value = options[key];
|
|
49
|
+
if (value === undefined || value === null || value === '') continue;
|
|
50
|
+
script.setAttribute(attribute, String(value));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Build the <script> element without inserting it. Useful when you want to
|
|
56
|
+
* place it yourself, or to inspect what would be inserted.
|
|
57
|
+
*
|
|
58
|
+
* @param {Object} [options] see ATTRIBUTES above
|
|
59
|
+
* @returns {HTMLScriptElement}
|
|
60
|
+
*/
|
|
61
|
+
export function createEmbedScript(options = {}) {
|
|
62
|
+
const script = document.createElement('script');
|
|
63
|
+
script.src = EMBED_SRC;
|
|
64
|
+
script.async = true;
|
|
65
|
+
applyOptions(script, options);
|
|
66
|
+
return script;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Insert the widget into the page.
|
|
71
|
+
*
|
|
72
|
+
* The loader places the widget immediately after its own <script> tag, so the
|
|
73
|
+
* tag is appended inside `target` and the widget appears there.
|
|
74
|
+
*
|
|
75
|
+
* @param {Element|string} [target] element or CSS selector; defaults to <body>
|
|
76
|
+
* @param {Object} [options] see ATTRIBUTES above
|
|
77
|
+
* @returns {HTMLScriptElement} the inserted script element
|
|
78
|
+
*/
|
|
79
|
+
export function mount(target, options = {}) {
|
|
80
|
+
if (typeof document === 'undefined') {
|
|
81
|
+
throw new Error(
|
|
82
|
+
'proxyverity-widget: mount() needs a DOM. Call it in the browser, not during server rendering.'
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// mount({ theme: 'dark' }) — target omitted, options passed first.
|
|
87
|
+
if (target && typeof target === 'object' && !(target instanceof Element)) {
|
|
88
|
+
options = target;
|
|
89
|
+
target = undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const element =
|
|
93
|
+
typeof target === 'string' ? document.querySelector(target) : target || document.body;
|
|
94
|
+
|
|
95
|
+
if (!element) {
|
|
96
|
+
throw new Error(`proxyverity-widget: no element matched ${JSON.stringify(target)}`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const script = createEmbedScript(options);
|
|
100
|
+
element.appendChild(script);
|
|
101
|
+
return script;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The snippet as a string, for server-side rendering or for pasting into a
|
|
106
|
+
* template. Attribute values are escaped for an HTML attribute context.
|
|
107
|
+
*
|
|
108
|
+
* @param {Object} [options] see ATTRIBUTES above
|
|
109
|
+
* @returns {string}
|
|
110
|
+
*/
|
|
111
|
+
export function embedTag(options = {}) {
|
|
112
|
+
const escape = (value) =>
|
|
113
|
+
String(value).replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<');
|
|
114
|
+
|
|
115
|
+
const attributes = Object.entries(ATTRIBUTES)
|
|
116
|
+
.filter(([key]) => {
|
|
117
|
+
const value = options[key];
|
|
118
|
+
return value !== undefined && value !== null && value !== '';
|
|
119
|
+
})
|
|
120
|
+
.map(([key, attribute]) => `\n ${attribute}="${escape(options[key])}"`)
|
|
121
|
+
.join('');
|
|
122
|
+
|
|
123
|
+
return `<script src="${EMBED_SRC}"\n async${attributes}></script>`;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export default { EMBED_SRC, createEmbedScript, mount, embedTag };
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proxyverity-widget",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Embeddable proxy checker widget: one script tag puts a working HTTP/HTTPS/SOCKS proxy checker on your page. No server, no account, no build step.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"proxy",
|
|
7
|
+
"proxy-checker",
|
|
8
|
+
"proxy-tester",
|
|
9
|
+
"proxy-list",
|
|
10
|
+
"proxy-validator",
|
|
11
|
+
"socks5",
|
|
12
|
+
"socks4",
|
|
13
|
+
"http-proxy",
|
|
14
|
+
"widget",
|
|
15
|
+
"embed",
|
|
16
|
+
"embeddable"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://proxyverity.com/proxy-checker-widget/",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/ProxyVerity/Proxy-Checker-Widget/issues"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/ProxyVerity/Proxy-Checker-Widget.git"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"author": "ProxyVerity (https://proxyverity.com/)",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./index.js",
|
|
30
|
+
"module": "./index.js",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./index.js",
|
|
34
|
+
"default": "./index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"index.js",
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE"
|
|
41
|
+
],
|
|
42
|
+
"sideEffects": false
|
|
43
|
+
}
|