1.确定服务器地址:
//确定服务器器地址,这里为本机地址
InetAddress inetAddress = null;
try {
inetAddress = InetAddress.getLocalHost();
}catch (UnknownHostException e){
...
}
2.开启服务器
//新建Server对象,并设置好监听的端口
RadiusServer server = new RadiusServer();
server.setListenAddress(inetAddress);
server.setAcctPort(8071);
server.setAuthPort(8072);
//开启服务
server.start(true, true);
2.启动客户端
//新建client对象
RadiusClient client = new RadiusClient(inetAddress.getHostAddress(), "00000000");
//设置发送到目的服务器的端口号
client.setAcctPort(8071);
client.setAuthPort(8072);
//申请认证
client.authenticate(userName, Password);
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。