http-tunnel-client/test/test.ts

35 lines
751 B
TypeScript
Raw Normal View History

2023-07-11 12:20:33 +07:00
import { startClient } from '../src/api';
async function main() {
const client = await startClient({
// port: 8081,
address: '172.17.0.2:8222',
2023-07-11 12:20:33 +07:00
options: {
profile: 'mytest',
},
});
2023-07-11 15:04:48 +07:00
console.log('Client started:', client?.getEndpoint());
2023-07-11 12:20:33 +07:00
setTimeout(async () => {
client?.stop();
}, 10000);
2023-07-11 12:20:33 +07:00
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
// import { createProxyServer } from './proxy';
// import { createProxyServer } from './proxy_tcp';
// const proxy = createProxyServer('https://git.cubetiqs.com', {
// proxyPort: 3005,
// basePath: '/',
// });
// const proxy = createProxyServer('192.168.0.202', 8081, {
// proxyPort: 3005,
// });