Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 427 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 427 Bytes

orpush

基于OpenResty的websocket推送框架

启动

nginx -p `pwd`/ -c conf/nginx.conf

连接

var s = new WebSocket('ws://localhost:8080/ws');

s.onmessage = function(v){
    console.log(v.data);
}

推送

curl -X POST \
  http://localhost:8080/emitor \
  -H 'content-type: application/json' \
  -d '{
    "session_id": 100001,
    "message": "Hello, World!"
}'