Coder Social home page Coder Social logo

go_im's Introduction

Instant messaging server 即时通讯服务器

基于go channel设计,使用tcp连接

部署

修改main.go 中的ip和port

1.编译

go build -o im_server user.go main.go server.go

2.后台运行

nohup ./im_server > im_server_out.log 2>&1 &

3.检查日志

cat im_server.log [im_server]2023/04/26 15:47:15.105781 main.go:27: -----imserver start run in pid:9843----- [im_server]2023/04/26 15:47:15.105787 server.go:94: -----imserver run in pid:9843 ok-----

ps -ef |grep "im_server" root 26186 6451 0 16:33 pts/0 00:00:00 ./im_server

4.客户端使用nc命令

nc 127.0.0.1 8888 进入界面

off: offline your client #关闭

who: list all client #在线用户

all: send a broadcast message. exp all:hello ==> send 'hello' #给所有人发消息

rename: change your name.exp rename:xxx ===> your name is xxx #修改自己昵称

sendto| send message to someone. exp sendto|username|msg #给某人发消息

5.体验地址

nc 106.52.49.30 8887

go_im's People

Stargazers

 avatar

Watchers

 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.