anews9340 commited on
Commit
d32a453
·
verified ·
1 Parent(s): 5cdcb1c

Update test.js

Browse files
Files changed (1) hide show
  1. test.js +4 -54
test.js CHANGED
@@ -1,13 +1,6 @@
1
- // const http = require('http');
2
- import http from 'node:http';
3
- import net from 'node:net';
4
- import { URL } from 'node:url';
5
-
6
-
7
-
8
- //const http = require('http');
9
- //const net = require('net');
10
- //const url = require('url');
11
 
12
  const PORT = 7860;
13
 
@@ -48,47 +41,4 @@ server.on('connect', (req, clientSocket, head) => {
48
 
49
  server.listen(PORT, () => {
50
  console.log(`Gemini Proxy server running on port ${PORT}`);
51
- });
52
- /*
53
- const hostname = '0.0.0.0';
54
- const port = 7860;
55
-
56
- const server = http.createServer((req, res) => {
57
-
58
- console.log('>>req.url'+req.url)
59
- // Set the response header
60
- res.writeHead(200, { 'Content-Type': 'application/json' });
61
-
62
- // Send a JSON response
63
- // const responseData = {
64
- // message: 'Hello from a Node.js HTTP server!',
65
- // path: req.url,
66
- // method: req.method,
67
- // timestamp: new Date().toISOString()
68
- // };
69
-
70
- // res.end(JSON.stringify(responseData, null, 2));
71
- res.end("ABD 345");
72
- });
73
-
74
-
75
- server.on('connect', (req, clientSocket, head) => {
76
-
77
- console.log('req.url ${req.url}')
78
- // req.url will be in the format "hostname:port" for a CONNECT request.
79
- const { port, hostname } = new URL(`http://${req.url}`);
80
-
81
- console.log(`[PROXY] Intercepted CONNECT request for: ${hostname}:${port}`);
82
-
83
-
84
- });
85
-
86
-
87
-
88
-
89
-
90
- server.listen(port, hostname, () => {
91
- console.log(`Server running at http://${hostname}:${port}/`);
92
- });
93
-
94
- */
 
1
+ const http = require('http');
2
+ const net = require('net');
3
+ const url = require('url');
 
 
 
 
 
 
 
4
 
5
  const PORT = 7860;
6
 
 
41
 
42
  server.listen(PORT, () => {
43
  console.log(`Gemini Proxy server running on port ${PORT}`);
44
+ });