diff --git a/README.md b/README.md index a2b201f..933195b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # golang-p2p-chat -console chat with auto reconnection written in go +console chat with auto reconnection and TLS encryption written in go + +### Installing + +``` +go get github.com/faroyam/golang-p2p-chat +``` + +## Getting Started + +1. Generate SSL keys for TSL +``` +bash makeCerts.sh +``` +2. Run chat +``` +go build chat.go && ./chat +``` \ No newline at end of file diff --git a/makeCerts.sh b/makeCerts.sh index 48e14ec..2473656 100644 --- a/makeCerts.sh +++ b/makeCerts.sh @@ -1,6 +1,7 @@ mkdir certs 2>/dev/null rm certs/* 2>/dev/null -echo "make server cert" -openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=$1" -echo "make client cert" -openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=$1" +echo "creating server cert" +openssl req -new -nodes -x509 -out certs/server.pem -keyout certs/server.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=example@mail.com" +echo "creating client cert" +openssl req -new -nodes -x509 -out certs/client.pem -keyout certs/client.key -days 3650 -subj "/C=RU/ST=MSK/L=MSK/O=Chat Company/OU=IT/CN=www.chat.com/emailAddress=example@mail.com" +echo "done" \ No newline at end of file