org.tinyradius.test
Class TestProxy

java.lang.Object
  extended by org.tinyradius.util.RadiusServer
      extended by org.tinyradius.proxy.RadiusProxy
          extended by org.tinyradius.test.TestProxy

public class TestProxy
extends org.tinyradius.proxy.RadiusProxy

Test proxy server. Listens on localhost:1812 and localhost:1813. Proxies every access request to localhost:10000 and every accounting request to localhost:10001. You can use TestClient to ask this TestProxy and TestServer with the parameters 10000 and 10001 as the target server. Uses "testing123" as the shared secret for the communication with the target server (localhost:10000/localhost:10001) and "proxytest" as the shared secret for the communication with connecting clients.


Constructor Summary
TestProxy()
           
 
Method Summary
 RadiusEndpoint getProxyServer(RadiusPacket packet, RadiusEndpoint client)
           
 java.lang.String getSharedSecret(java.net.InetSocketAddress client)
          Returns the shared secret used to communicate with the client with the passed IP address or null if the client is not allowed at this server.
 java.lang.String getUserPassword(java.lang.String userName)
          Returns the password of the passed user.
static void main(java.lang.String[] args)
           
 
Methods inherited from class org.tinyradius.proxy.RadiusProxy
getProxyPort, getProxySocket, handlePacket, proxyPacket, proxyPacketReceived, setProxyPort, setSocketTimeout, start, stop
 
Methods inherited from class org.tinyradius.util.RadiusServer
accessRequestReceived, accountingRequestReceived, copyProxyState, getAcctPort, getAcctSocket, getAuthPort, getAuthSocket, getDuplicateInterval, getListenAddress, getSocketTimeout, isPacketDuplicate, listen, listenAcct, listenAuth, makeDatagramPacket, makeRadiusPacket, setAcctPort, setAuthPort, setDuplicateInterval, setListenAddress, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestProxy

public TestProxy()
Method Detail

getProxyServer

public RadiusEndpoint getProxyServer(RadiusPacket packet,
                                     RadiusEndpoint client)
Specified by:
getProxyServer in class org.tinyradius.proxy.RadiusProxy

getSharedSecret

public java.lang.String getSharedSecret(java.net.InetSocketAddress client)
Description copied from class: RadiusServer
Returns the shared secret used to communicate with the client with the passed IP address or null if the client is not allowed at this server.

Specified by:
getSharedSecret in class RadiusServer
Parameters:
client - IP address and port number of client
Returns:
shared secret or null

getUserPassword

public java.lang.String getUserPassword(java.lang.String userName)
Description copied from class: RadiusServer
Returns the password of the passed user. Either this method or accessRequestReceived() should be overriden.

Specified by:
getUserPassword in class RadiusServer
Parameters:
userName - user name
Returns:
plain-text password or null if user unknown

main

public static void main(java.lang.String[] args)