@@ -0,0 +1,2027 @@
+package com.github.noxan.aves.demo;%0A%0Aimport java.io.IOException;%0A%0Aimport com.github.noxan.aves.auth.AuthException;%0Aimport com.github.noxan.aves.auth.accessor.UsernamePassword;%0Aimport com.github.noxan.aves.auth.accessor.UsernamePasswordAccessor;%0Aimport com.github.noxan.aves.auth.storage.InMemoryUsernamePasswordStorage;%0Aimport com.github.noxan.aves.net.Connection;%0Aimport com.github.noxan.aves.server.ServerAdapter;%0Aimport com.github.noxan.aves.server.SocketServer;%0A%0Apublic class AuthServer extends ServerAdapter %7B%0A    public static void main(String%5B%5D args) %7B%0A        new AuthServer();%0A    %7D%0A%0A    private InMemoryUsernamePasswordStorage userStorage;%0A%0A    public AuthServer() %7B%0A        userStorage = new InMemoryUsernamePasswordStorage();%0A        userStorage.addUser(%22noxan%22, %22123%22);%0A%0A        SocketServer server = new SocketServer(this);%0A        server.start();%0A    %7D%0A%0A    @Override%0A    public void readData(Connection connection, Object data) %7B%0A        String parts%5B%5D = ((String) data).trim().split(%22 %22);%0A        String message = parts%5B0%5D.toUpperCase();%0A        String%5B%5D args = new String%5Bparts.length - 1%5D;%0A        System.arraycopy(parts, 1, args, 0, args.length);%0A        try %7B%0A            switch (message) %7B%0A            case %22LOGIN%22:%0A                if (args.length %3E 1) %7B%0A                    UsernamePasswordAccessor accessor = new UsernamePassword(args%5B0%5D, args%5B1%5D);%0A                    try %7B%0A                        String user = userStorage.requestUser(accessor);%0A                        connection.write(%22WELCOME %22 + user);%0A                    %7D catch (AuthException e) %7B%0A                        connection.write(%22LOGIN ERROR: %22 + e.getMessage());%0A                    %7D%0A                %7D else %7B%0A                    connection.write(%22LOGIN ERROR: Invalid parameter(s)%22);%0A                %7D%0A                break;%0A            case %22LOGOUT%22:%0A                connection.write(%22Not implemented yet!%22);%0A                break;%0A            %7D%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%7D%0A

move auth server from aves repo to demo repo