public boolean connect() throws Exception {
		if (socket != null) {
			disconnect();
		}
		try {
			Proxy proxy = Proxy.NO_PROXY; 
			/*if (useProxy) {
				SocketAddress address = new InetSocketAddress("87.200.196.60", 80);
				proxy = new Proxy(Proxy.Type.SOCKS, address);
			}*/
			socket = new Socket(proxy);
			socket.connect(new InetSocketAddress(ip, port));
			writer = new BufferedWriter(new OutputStreamWriter(
					socket.getOutputStream()));
			reader = new BufferedReader(new InputStreamReader(
					socket.getInputStream()));

			writer.write("PASS " + settings.pass);
			writer.newLine();
			writer.write("NICK " + settings.nick);
			writer.newLine();
			writer.write("USER " + settings.user + " 8 * : Java IRC Client by zaboing");
			writer.newLine();
			writer.flush();

			String line = null;
			while ((line = reader.readLine()) != null) {
				System.out.println(line);
				if (line.indexOf("004") >= 0) {
					socket.setSoTimeout(5000);
					receiveThread = new Thread(this);
					receiveThread.setDaemon(true);
					receiveThread.start();
					return true;
				} else if (line.indexOf("433") >= 0) {
					System.out.println("Nickname is already in use.");
					return false;
				}
			}

			return false;
		} catch (Exception e) {
			throw e;
		}
	}