detectServerPort static method

String detectServerPort(
  1. Request req
)

Detects the request's destination port number.

  • req an HTTP RequestContext request to process. Returns the detected port number or 80 (if none are detected).

Implementation

static String detectServerPort(Request req) {
  return req.url.port.toString(); //req.socket.localPort;
}