Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.34 KB

Readme.md

File metadata and controls

65 lines (43 loc) · 1.34 KB

GRPC-Chat Server and Client

Setup

  1. cp env.txt .env
  2. update the db details in the .env file
  • if you want tests to work setup the TEST... variables as well

make build

  1. Executable is out/grpc-chat
  2. Migrate the db

./out/grpc-chat migrate

  1. Run the server

./out/grpc-chat server

  1. Run the client in console mode

./out/grpc-chat client console hostname port [ssl|nossl] use ssl if you have an nginx to terminate the ssl

  1. You should see

->

prompt

Prompt commands for client

  1. login <username> <password>
  • this logs you in. The server doesnt do authentication rt now, so the key is useless
  1. create_chat <chat name>
  • creates a new chat
  1. list_chats
  • lists all the chats available on the server
-> list_chats
ChatName	ChatID	UserIDs
blublu	5fa89b3d-e154-44c4-ad41-785d8a330535	a39b2fdf-e5d0-41a1-8893-c4cfb7ae6bb0,fee1adb3-d969-4258-8907-224fa2bc284b
bumbum	8cd61367-8556-4bfb-a3aa-940b7f209700	a39b2fdf-e5d0-41a1-8893-c4cfb7ae6bb0
baby	8d8c3079-c679-4f29-81a7-114eb4e8fe44	a39b2fdf-e5d0-41a1-8893-c4cfb7ae6bb0
  1. start_chat <chat name>
  • use the first column from list_chats output.
  1. now just type and you should see the chat on all clients who have connected.
  • other users will have their username prefixed
-> start_chat blublu
Hi I am param
anil:hello
anil:I am anil
  1. quit to exit a chat