Code Monkey home page Code Monkey logo

cal's Introduction

CAL

Chat between peers, without any other infrastructure.

Created by Foo-Manroot.

Functionalities

This chat, written in Java, has only one .jar file where the functionalities for a server and a client are implemented. That means that there's no need for a server to be running, but anyone can connect to any host at any time.

As no server is needed, there's no way to control the activity of a single user,and that means more privacy than a simple client-server chat. For the moment, the messages aren't encrypted; but it seems that the release of Java 9 adds support for DTLS, so it's possible that it'll be implemented on this chat, too (even though it's a personal project and its implementation on this chat may not be correctly done and, therefore, the encryption would be useless).

Java 8 is needed for this program to be executed correctly.

Build and execution

There are two different ways to execute this program: building it from source, or downloading the pre-built .jar

Building from source

  1. Download the source of the the latest release and uncompress the downloaded file (or simply clone the repository).

  2. Create the output directory for the .class files (e.g.: mkdir build).

  3. Go to the src/ directory and compile the .java with javac -verbose -d ../build */*.java (-verbose isn't necessary, but recommended).

  4. After creating the .class files, go to the output directory (cd ../build) and create the manifest file needed for the .jar. The manifest (named Manifest.txt in this example) file should, at least, have the following line (with a new line after the main class declaration):

> Main-Class: main.Main
  1. Before creating the final .jar, some resources must be copied to the dist/ directory:
cp -rv ../src/resources .

cp -v ../src/gui/FXMLPeer.fxml gui/
  1. Now, the .jar file can be finnaly created. To this end, the program jar is needed. It should be located at (java_root_directory)/bin/jar. The command to execute, supposing the output .jar will be named CAL.jar, the manifest file is Manifest.txt and the current directory is build/, is the following: (java_root_directory)/bin/jar cvfm CAL.jar Manifest.txt */*

Downloading the pre-built .jar

Simply download the latest release and execute the file with java -jar CAL.jar

Usage

One of the objectives of this project is to make a fairly simple and friendly interface (for the moment it has plain and inelegant interface, but it wil be changed to a prettier and easier to use one).

The main interface has a main pane that occupies the majority of the interface and two little panels on the right to show error and warning messages (they can be hidden). Below there are also two buttons to establish a new connection (button 'connect') and to check the connection with all the known peers (button 'check connection').

To establish a new connection, both the button 'connect' and the '+' symbol on the tab panel can be pressed. After that, a little dialog is shown to enter the details of the host with which the connection will be done. The parameters to the new connection are the following:

  • IP address: it can be IPv4 or IPv6. It hasn't been tested with IPv6, though; but it should work correctly.
  • Port: port where the other peer is listening for incoming connections (the title of the main window should be 'peer listening on X', being X the port number).
  • Chat room ID: every peer can handle up to (2^8 - 2) different connections (254, from -128 to 126). This doesn't mean that it can be connected to a maximum of 254 peers, but it can bee connected to a maximum of 254 rooms. The maximum size of each room isn't limited.

Once that the connection is achieved, a new tab will be automatically added to the tabs panel and the conversation can start.

Commands

To add more functionalities to the chat, there are commands that can be executed adding the escape character '/' to the start of the line.

Also, there has been implemented an auto-completion utility so the TAB key can be pressed and the completed command (or, with another hit of the TAB key, a possible suggestion) can be shown. An example of this functionality:

/h(TAB)
(TAB)
Suggestions: /help /hosts

Another example:

/he(TAB)
/help     # Auto-completed after the TAB key is pressed.

There are a few supported commands, but there is a work in progress to add more functionalities. For the moment, the supported commands are:

  • /help: shows a message with the available commands and their explanation
  • /hosts: Shows a list with information about the hosts. If no parameters are given, it shows only information about the hosts on the current room. To show all the rooms, the parameter "all" must be added.
  • /leave: Leaves the current chat room.
  • /exit: Disconnects the user from all the rooms.
  • /send: Opens a window to select a file and sends it to the rest of the hosts on the room.

cal's People

Contributors

foo-manroot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.