This commit is contained in:
irungentoo 2013-07-19 10:57:23 -04:00
commit 8a50c04725
3 changed files with 68 additions and 58 deletions

View File

@ -1,40 +1,34 @@
Tox
===
![Project Tox](https://rbt.asia/boards/g/img/0352/79/1373823047559.png "Project Tox")
Project Tox, _also known as Tox_, is a FOSS instant messaging application aimed to replace Skype.<br />
[![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core)
Current IRC: #InsertProjectNameHere
on Freenode or [webchat](https://webchat.freenode.net/)
With the rise of governmental monitoring programs, Tox aims to be an easy to use application that allows people to connect with friends and loved ones without the worry of privacy.<br /> <br />
Proposal of a free as in freedom skype replacement:
## Basics:
UDP must be used for everything simply because you can't do hole punching with TCP (well you can but it doesn't work all the time)
Every peer is represented as a byte string (the client id) (It is the public key of the peer.). (if you want to add someone you need that id (either ask that person directly or maybe through some kind of search engine?))
Use something torrent DHT style so that peers can find the ip of the other peers when they have their id.
Once the client has the ip of that peer they start initiating a secure connection with each other.(See Crypto.)
When both peers are securely connected with the encryption they can securely exchange messages, initiate a video chat, send files, etc...
Your client stores the public keys/id of the peers used to initiate the connection (this is your contacts list)
**IRC**: #InsertProjectNameHere on Freenode, alternatively, you can use the [webchat](https://webchat.freenode.net/).<br />
**Website**: [http://projecttox.org](http://projecttox.org)
## The Complex Stuff:
+ Tox must use UDP simply because you can't hole punch with TCP. It's possible, but it doesn't work all the time.
+ Every peer is represented as a byte string (the public key of the peer [client id])
+ We're using torrent-style DHT so that peers can find the IP of the other peers when they have their ID.
+ Once the client has the IP of that peer, they start initiating a secure connection with each other. (See [Crypto](https://github.com/irungentoo/ProjectTox-Core/blob/master/docs/Crypto.txt))
+ When both peers are securely connect with the encryption, they can securely exchange messages, initiate a video chat, send files, etc.<br />
+ Current build status: [![Build Status](https://travis-ci.org/irungentoo/ProjectTox-Core.png?branch=master)](https://travis-ci.org/irungentoo/ProjectTox-Core)
## Roadmap:
- [x] Get our DHT working perfectly.(Done, needs large scale testing though.)
- [x] Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example)
- [x] Encryption. (Done)
- [ ] Get a simple text only im client working perfectly. (This is where we are)
- [ ] Streaming media
- [ ] ???
1. Get our DHT working perfectly.(Done, needs large scale testing though.)
2. Reliable connection (See Lossless_UDP protocol) to other peers according to client id. (Done, see DHT_sendfiletest.c for an example)
3. Encryption. (Done)
4. Get a simple text only im client working perfectly. (This is where we are)
5. Streaming media
6.
For further information, check our [To-Do list](https://github.com/irungentoo/InsertProjectNameHere/blob/master/docs/TODO.txt).
## TODO:
See: [docs/TODO.txt](https://github.com/irungentoo/InsertProjectNameHere/blob/master/docs/TODO.txt)
### Important-stuff:
@ -42,18 +36,16 @@ Use the same UDP socket for everything
Keep everything really simple.
### Details:
### Details and Documents:
DHT protocol:
see: [docs/DHT.txt](/docs/DHT.txt)
Lossless UDP protocol:
Either we find one with an already working implementation (Didn't find a good implementation, writing my own)
see also: [docs/Lossless_UDP.txt](/docs/Lossless_UDP.txt)
Crypto:
see: [docs/Crypto.txt](/docs/Crypto.txt)
[DHT Protocol](/docs/DHT.txt)<br />
[Lossless UDP Protocol](/docs/Lossless_UDP.txt)<br />
[Crypto](/docs/Crypto.txt)<br />
[Ideas](/docs/IDEAS.txt)
### Why are you doing this? There are already a bunch of free skype alternatives.
see: [docs/WHY.txt](/docs/WHY.txt)
The goal of this project is to create a configuration free p2p skype
replacement. Configuration free means that the user will simply have to open the program and
without any account configuration will be capable of adding people to his
friends list and start conversing with them. There are many so called skype replacements and all of them are either hard to
configure for the normal user or suffer from being much too centralized.

View File

@ -1,10 +0,0 @@
The goal of this project is to create a configuration free p2p skype
replacement.
Configuration free means that the user will simply have to open the program and
without any account configuration will be capable of adding people to his
friends list and start conversing with them.
There are many so called skype replacements and all of them are either hard to
configure for the normal user or suffer from being much too centralized.

View File

@ -1,13 +1,13 @@
/* DHT boostrap
*
*
* A simple DHT boostrap server for tox.
*
* Build commands (use one or the other):
*
* Build commands (use one or the other):
* gcc -O2 -Wall -D VANILLA_NACL -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c ../nacl/build/${HOSTNAME%.*}/lib/amd64/{cpucycles.o,libnacl.a,randombytes.o} DHT_bootstrap.c
*
*
* gcc -O2 -Wall -o bootstrap_server ../core/Lossless_UDP.c ../core/network.c ../core/net_crypto.c ../core/Messenger.c ../core/DHT.c -lsodium DHT_bootstrap.c
*/
#include <arpa/inet.h>
#include "../core/DHT.h"
@ -21,7 +21,19 @@
#define PORT 33445
unsigned char * hex_string_to_bin(char hex_string[])
{
unsigned char * val = malloc(strlen(hex_string));
char * pos = hex_string;
int i=0;
while(i < strlen(hex_string))
{
sscanf(pos,"%2hhx",&val[i]);
pos+=2;
i++;
}
return val;
}
int main(int argc, char *argv[])
{
@ -42,13 +54,29 @@ int main(int argc, char *argv[])
init_networking(ip, PORT);
perror("Initialization");
if (argc > 3) {
printf("Trying to bootstrap into the network...\n");
IP_Port bootstrap_info;
bootstrap_info.ip.i = inet_addr(argv[1]);
bootstrap_info.port = htons(atoi(argv[2]));
uint8_t *bootstrap_key = hex_string_to_bin(argv[3]);
DHT_bootstrap(bootstrap_info, bootstrap_key);
free(bootstrap_key);
}
IP_Port ip_port;
uint8_t data[MAX_UDP_PACKET_SIZE];
uint32_t length;
int is_waiting_for_dht_connection = 1;
while(1)
{
{
if (is_waiting_for_dht_connection && DHT_isconnected())
{
printf("Connected to other bootstrap server successfully.\n");
is_waiting_for_dht_connection = 0;
}
doDHT();
while(receivepacket(&ip_port, data, &length) != -1)
@ -58,5 +86,5 @@ int main(int argc, char *argv[])
c_sleep(1);
}
shutdown_networking();
return 0;
return 0;
}