Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function main(arg) {
- const server = http.createServer();
- const wss = new WebSocket.Server({ server });
- server.listen(4444);
- wss.on("connection", function connection(wss) {
- const ws = new WebSocket(
- "wss://server.example.com",
- {
- agent: arg ? new SocksProxyAgent("socks://" + arg) : false, // socket5 proxy
- headers: {
- "User-Agent":
- "Firefox/102.0",
- },
- origin: "https://example.com", // origin
- }
- );
- ws.on("message", function incoming(data) {
- wss.send(data.toString());
- });
- wss.on("message", function incoming(data) {
- ws.send(data.toString());
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment