src/main/java/org/tinyradius/proxy/RadiusProxy.java
protected RadiusPacket handlePacket(InetSocketAddress localAddress, InetSocketAddress remoteAddress, RadiusPacket request, String sharedSecret)
        throws RadiusException, IOException {
        // handle incoming proxy packet
        if (localAddress.getPort() == getProxyPort()) {
            proxyPacketReceived(request, remoteAddress);
            return null;
        }

        // handle auth/acct packet
        RadiusEndpoint radiusClient = new RadiusEndpoint(remoteAddress, sharedSecret);
        RadiusEndpoint radiusServer = getProxyServer(request, radiusClient);
        if (radiusServer != null) {
            // proxy incoming packet to other radius server
            RadiusProxyConnection proxyConnection = new RadiusProxyConnection(radiusServer, radiusClient, request, localAddress.getPort());
            logger.info("proxy packet to " + proxyConnection);
            proxyPacket(request, proxyConnection);
            return null;
        }
        else {
            // normal processing
            return super.handlePacket(localAddress, remoteAddress, request, sharedSecret);
        }
    }
/**
     * Handles packets coming in on the proxy port. Decides whether
     * packets coming in on Auth/Acct ports should be proxied.
     */
Handles packets coming in on the proxy port. Decides whether
packets coming in on Auth/Acct ports should be proxied.
Handles packets coming in on the proxy port . Decides whether packets coming in on Auth / Acct ports should be proxied .
protected RadiusPacket handlePacket(InetSocketAddress localAddress, InetSocketAddress remoteAddress, RadiusPacket request, String sharedSecret)
        throws RadiusException, IOException {
        if (localAddress.getPort() == getProxyPort()) {
            proxyPacketReceived(request, remoteAddress);
            return null;
        }
        RadiusEndpoint radiusClient = new RadiusEndpoint(remoteAddress, sharedSecret);
        RadiusEndpoint radiusServer = getProxyServer(request, radiusClient);
        if (radiusServer != null) {
            RadiusProxyConnection proxyConnection = new RadiusProxyConnection(radiusServer, radiusClient, request, localAddress.getPort());
            logger.info("proxy packet to " + proxyConnection);
            proxyPacket(request, proxyConnection);
            return null;
        }
        else {
            return super.handlePacket(localAddress, remoteAddress, request, sharedSecret);
        }
    }
protected RadiusPacket handlePacket ( InetSocketAddress localAddress , InetSocketAddress remoteAddress , RadiusPacket request , String sharedSecret ) throws RadiusException , IOException { if ( localAddress . getPort ( ) == getProxyPort ( ) ) { proxyPacketReceived ( request , remoteAddress ) ; return null ; } RadiusEndpoint radiusClient = new RadiusEndpoint ( remoteAddress , sharedSecret ) ; RadiusEndpoint radiusServer = getProxyServer ( request , radiusClient ) ; if ( radiusServer != null ) { RadiusProxyConnection proxyConnection = new RadiusProxyConnection ( radiusServer , radiusClient , request , localAddress . getPort ( ) ) ; logger . info ( "proxy packet to " + proxyConnection ) ; proxyPacket ( request , proxyConnection ) ; return null ; } else { return super . handlePacket ( localAddress , remoteAddress , request , sharedSecret ) ; } }
Handles packets coming in on the proxy port.
Handles packets coming in on the proxy port .
// handle incoming proxy packet
 // handle auth/acct packet
 // proxy incoming packet to other radius server
 // normal processing
