-
- 设置代理
- {proxyList.length}
-
-
{
- setProxyList([
- ...proxyList,
- {
- id: Math.random() + "",
- scheme: "http",
- host: "",
- port: "",
- hostStatus: "",
- portStatus: "",
- open: false,
- },
- ]);
- }}
- >
-
添加
-
-
-
- {proxyList.length ? (
- proxyList.map((item) => (
-
-
-
-
- hostOnchange(e.target.value, item.id)}
- />
- portOnchange(e.target.value, item.id)}
- />
-
-
- {!item.open && (
- {
- setProxyList(proxyList.filter((i) => i.id !== item.id));
- }}
- />
- )}
- {
- wsc.clearproxy();
- const copyProxyList = structuredClone(proxyList);
- copyProxyList.forEach((i) => {
- if (i.id === item.id) {
- i.open = checked;
- if (checked) {
- wsc.setproxy(item.scheme, item.host, Number(item.port));
- }
- } else {
- i.open = false;
- }
- });
- setProxyList(copyProxyList);
- }}
- />
-
- ))
- ) : (
-
{
- setProxyList([
- {
- id: Math.random() + "",
- scheme: "http",
- host: "127.0.0.1",
- port: "8083",
- hostStatus: "",
- portStatus: "",
- open: false,
- },
- ]);
- }}
- >
-
-
添加
-
- )}
-