netsh interface portproxy add v4tov4 protocol=tcp connectaddress=192.168.67.128 connectport=9091 listenport=9091
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require("http"), | |
url = require("url"); | |
http.createServer((proxyReq, proxyRes) => { | |
console.log(proxyReq.url); | |
const options = url.parse(proxyReq.url); | |
const svr = http.request(options, svrRes => { | |
svrRes.pipe(proxyRes, { end: true }); | |
}); | |
proxyReq.pipe(svr, { |
How to import *.json
?
As already answered you need Typescript >= 2.9 and the following settings in tsconfig.json:
{
"resolveJsonModule": true,
"esModuleInterop": true,
"module": "commonjs"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { appendFile, existsSync, mkdirSync } from "fs"; | |
import { join } from "path"; | |
let GLOBAL_COUNT = 0; | |
export class Log { | |
private dir: string | |
constructor(private name: string) { | |
this.dir = join(process.cwd(), "logs"); | |
this.checkDir(); | |
} |
OlderNewer