Coder Social home page Coder Social logo

hrygo / gosms Goto Github PK

View Code? Open in Web Editor NEW
46.0 3.0 7.0 271 KB

gosms: 采用Golang与gnet框架实现的高性能短信网关(SMC短信中心模拟)。

License: MIT License

Go 99.28% Shell 0.18% Makefile 0.54%
sms cmpp smpp sms-gateway sgip gnet golang smgp

gosms's Introduction

GOSMS

TODO

  • 服务端优雅停机
  • 联通MO消息及Report消息支持
  • 服务端日志采用hooker持久化存储到ES

Quick Start

从源码构建并启动

# 修改 .env 文件中的 GOARCH 为目标平台的 CPU 架构. 常用的值 amd64, arm64, i386, armhf等
# 构建服务端
make linux
# make darwin

# 构建客户端 
make client

cd publish
mv gosms-* gosms
# 启动服务端 
./start.sh

# 启动客户端
cd cli
./smscli -p 13800001111 -m 'hello world, 你好世界!' -i 10000
# -p 手机号
# -m 短信内容
# -i 迭代次数

采用mongodb存储客户端认证配置

1.修改配置文件 /config/config.yaml

AuthClient:
  StoreType: "mongo"
Mongo:
  URI: "mongodb+srv://<user>:<passwd>@cluster0.ppiyq4w.mongodb.net/test"
  ConnectTimeout: 15s
  ReadTimeout: 15s
  WriteTimeout: 15s
  HeartbeatInterval: 60s
  MinPoolSize: 2
  MaxPoolSize: 10

2.然后通过环境变量设置用户名密码

export MONGO_USER=xxx
export MONGO_PASSWD=xxx

3.初始化mongodb数据

make mongo

4.如果不启用MongoDB,需设置

AuthClient:
  StoreType: "yml"

Mongo:
  URI: ""

采用mongodb存储客户端消息发送记录

同上,修改smc_client对应的配置文件。如果不启用MongoDB,不设置 Mongo.URI 即可。

功能及原理说明

TODO 其他说明文档待补充

gosms's People

Contributors

aaronwong1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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