mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
feat(wsc) brute encrypt demo
This commit is contained in:
+2
-1
@@ -22,7 +22,7 @@ export class WebSocketManager {
|
|||||||
|
|
||||||
this.socket.onopen = () => {
|
this.socket.onopen = () => {
|
||||||
chrome.runtime.sendMessage({action: ActionType.STATUS, connected: true, port: port});
|
chrome.runtime.sendMessage({action: ActionType.STATUS, connected: true, port: port});
|
||||||
this.startHeartbeat();
|
// this.startHeartbeat();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.socket.onmessage = (event) => {
|
this.socket.onmessage = (event) => {
|
||||||
@@ -42,6 +42,7 @@ export class WebSocketManager {
|
|||||||
sendMessage(message) {
|
sendMessage(message) {
|
||||||
if (this.isConnected()) {
|
if (this.isConnected()) {
|
||||||
try {
|
try {
|
||||||
|
console.log("发射", message)
|
||||||
this.socket.send(JSON.stringify(message));
|
this.socket.send(JSON.stringify(message));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error sending message:", e);
|
console.error("Error sending message:", e);
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ function App() {
|
|||||||
>
|
>
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Contro/>
|
<Contro/>
|
||||||
<Proxifier/>
|
{/*<Proxifier/>*/}
|
||||||
|
|
||||||
<EvalInTab/>
|
<EvalInTab/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, {useEffect, useState} from "react";
|
||||||
import { Space, Select, Input, Switch } from "antd";
|
import {Space, Select, Input, Switch} from "antd";
|
||||||
import { PlusSmIcon, TrashIcon } from "@assets/icon/icon";
|
import {PlusSmIcon, TrashIcon} from "@assets/icon/icon";
|
||||||
import { wsc } from "@network/chrome";
|
import {wsc} from "@network/chrome";
|
||||||
import "./Proxifier.css";
|
import "./Proxifier.css";
|
||||||
|
|
||||||
type Scheme = "http" | "socks5";
|
type Scheme = "http" | "socks5";
|
||||||
@@ -68,6 +68,7 @@ export const Proxifier: React.FC<ProxifierProps> = () => {
|
|||||||
wsc.updateProxyStatus();
|
wsc.updateProxyStatus();
|
||||||
|
|
||||||
wsc.onProxyStatusMessage((msg) => {
|
wsc.onProxyStatusMessage((msg) => {
|
||||||
|
console.log("msg", msg)
|
||||||
if (msg.proxy === undefined || msg.enable === undefined) {
|
if (msg.proxy === undefined || msg.enable === undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -206,7 +207,7 @@ export const Proxifier: React.FC<ProxifierProps> = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="Prox-add-text">添加</span>
|
<span className="Prox-add-text">添加</span>
|
||||||
<PlusSmIcon className="Prox-add-icon" />
|
<PlusSmIcon className="Prox-add-icon"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="Prox-list-wrap">
|
<div className="Prox-list-wrap">
|
||||||
@@ -217,7 +218,7 @@ export const Proxifier: React.FC<ProxifierProps> = () => {
|
|||||||
<Space.Compact>
|
<Space.Compact>
|
||||||
<Select
|
<Select
|
||||||
value={item.scheme}
|
value={item.scheme}
|
||||||
style={{ width: 88 }}
|
style={{width: 88}}
|
||||||
disabled={item.open}
|
disabled={item.open}
|
||||||
onChange={(value, option) => {
|
onChange={(value, option) => {
|
||||||
const copyProxyList = structuredClone(proxyList);
|
const copyProxyList = structuredClone(proxyList);
|
||||||
@@ -235,14 +236,14 @@ export const Proxifier: React.FC<ProxifierProps> = () => {
|
|||||||
</Select>
|
</Select>
|
||||||
<Input
|
<Input
|
||||||
value={item.host}
|
value={item.host}
|
||||||
style={{ width: 136 }}
|
style={{width: 136}}
|
||||||
disabled={item.open}
|
disabled={item.open}
|
||||||
status={item.hostStatus}
|
status={item.hostStatus}
|
||||||
onChange={(e) => hostOnchange(e.target.value, item.id)}
|
onChange={(e) => hostOnchange(e.target.value, item.id)}
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
value={item.port}
|
value={item.port}
|
||||||
style={{ width: 64 }}
|
style={{width: 64}}
|
||||||
disabled={item.open}
|
disabled={item.open}
|
||||||
status={item.portStatus}
|
status={item.portStatus}
|
||||||
onChange={(e) => portOnchange(e.target.value, item.id)}
|
onChange={(e) => portOnchange(e.target.value, item.id)}
|
||||||
@@ -300,7 +301,7 @@ export const Proxifier: React.FC<ProxifierProps> = () => {
|
|||||||
]);
|
]);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<PlusSmIcon className="add-list-icon" />
|
<PlusSmIcon className="add-list-icon"/>
|
||||||
<span className="add-list-text">添加</span>
|
<span className="add-list-text">添加</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user