Java Authenticator getRequestingSite() 方法

2025 年 3 月 20 日 | 阅读 2 分钟

Authenticator 类的 getRequestingSite() 方法用于获取请求授权的站点的 InetAddress,如果不可用则返回 null。

语法

参数

不传递任何参数。

返回

请求授权站点的 InetAddress,如果不可用则返回 null。

Throw

不抛出异常

示例 1

输出

Port info ::-1
Site:null
//source code of https://tpointtech.cn is printed. 

示例 2

输出

Site info :null
Protocol:https
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
//Source code of https://www.TpointTech is printed.