Small tweaks

This commit is contained in:
raul 2024-05-14 15:59:23 +02:00
parent 93c76f4242
commit b2f9ff5016
3 changed files with 5 additions and 5 deletions

View File

@ -25,7 +25,7 @@ Flags:
### Server
```
Example:
./mini-chat server --port 1337
./mini-chat server --port 1337 --history chat.log --password coolh4x0r1337
Usage:
mini-chat server [flags]
@ -35,5 +35,5 @@ Flags:
-r, --history string File to store and recover chat history from
--insecure [UNSAFE] Do not use TLS encryption
--password string Password for accessing the chat server
-p, --port string port to use for listening (default "1302")
-p, --port string Port to use for listening (default "1302")
```

View File

@ -131,7 +131,7 @@ func listenMessages(g *gocui.Gui) {
}
func receiveMessage(conn net.Conn) (s string, b int, err error) {
serverMessage := make([]byte, 2048)
serverMessage := make([]byte, 1536)
n, err := conn.Read(serverMessage)
if err != nil {
return "", 0, err

View File

@ -16,7 +16,7 @@ var serverCmd = &cobra.Command{
using a proper interface this time, not using netcat.
Example:
./mini-chat server --port 1337`,
./mini-chat server --port 1337 --history chat.log --password coolh4x0r1337`,
Run: func(cmd *cobra.Command, args []string) {
if err := setServerParameters(cmd); err != nil {
@ -29,7 +29,7 @@ Example:
func init() {
rootCmd.AddCommand(serverCmd)
serverCmd.PersistentFlags().StringP("port", "p", "1302", "port to use for listening")
serverCmd.PersistentFlags().StringP("port", "p", "1302", "Port to use for listening")
serverCmd.PersistentFlags().StringP("history", "r", "", "File to store and recover chat history from")
serverCmd.PersistentFlags().String("password", "", "Password for accessing the chat server")
serverCmd.Flags().Bool("insecure", false, "[UNSAFE] Do not use TLS encryption")