remoteAddr
remoteAddr
ctx
对象的remoteAddr
属性用于获取请求的远程地址。
示例
import {HttpServer} from "http";
let server = new HttpServer({
addr: ":8090",
});
server.any("/test", (ctx) => {
console.log("远程地址:", ctx.remoteAddr);
});
server.start();
ctx
对象的remoteAddr
属性用于获取请求的远程地址。
示例
import {HttpServer} from "http";
let server = new HttpServer({
addr: ":8090",
});
server.any("/test", (ctx) => {
console.log("远程地址:", ctx.remoteAddr);
});
server.start();