Coder Social home page Coder Social logo

client-server-chat's Introduction

Go Client/Server Chatroom

This is a sample multi-client/server done in golang. Has simple user logins and useranme validation.

How to run

To run you simply need two terminals, one to act as a client, and the other one as server

Server

You first need to start the server by either:

  • Running the demoServer.sh script
    me@garciaErick:/path/to/repo/$ ./demoServer.sh
  • Running the following command
    me@garciaErick:/path/to/repo/$ go run server.go authenticatedUser.go

Client

Afterwards you can connect multiple clients to the server by running the following in a separate terminal:

  • Running the demoClient.sh script
    me@garciaErick:/path/to/repo/$ ./demoClient.sh
  • Running the following command
    me@garciaErick:/path/to/repo/$ go run chatroom.go client.go  uuidGenerator.go

Demo

  • The server supports multiple clients, and each connection is aware of the current user, so messages from server are personalized for each client. alt text

  • Additionally there is some simple validation, no duplicate usernames are allowed and no illegal characters are allowed, as an example ':' (colon) is an illegal character for a username alt text

client-server-chat's People

Contributors

garciaerick avatar

Watchers

 avatar  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.