Skip to content

About

Local Chat Backend

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

local-chat-backend

Go example server for a LOCO-style local chat backend.

This is intentionally small and dependency-free:

  • TCP server on 127.0.0.1:5050
  • HTTP diagnostics on 127.0.0.1:8080
  • LOCO-style frame:
    • 4B id
    • 2B status
    • 11B method
    • 1B type
    • 4B body length
    • BSON body

Run

cd local-chat-backend
go run ./cmd/local-chat-backend

HTTP diagnostics

Invoke-RestMethod http://127.0.0.1:8080/healthz
Invoke-RestMethod http://127.0.0.1:8080/sessions

Chat messages do not go through HTTP. A client sends a TCP WRITE packet, then the server responds to that request and broadcasts a TCP MSG push packet to connected sessions.

Supported LOCO methods

  • PING
  • CHECKIN
  • LOGINLIST
  • LCHATLIST
  • CHATINFO
  • CHATONROOM
  • WRITE

Important

This sample reads and writes the plain LOCO packet structure. It does not implement the Kakao V2SL RSA/AES-GCM handshake.

For a real private local server, change the client to either:

  1. use plain local TCP while testing, or
  2. use your own RSA public key in the client and implement the matching V2SL handshake in this server with your private key.

About

Local Chat Backend

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages