I want to create a real time notification system for my website(social network) I'm using laravel 5.2, I am using socket.io and redis currently, I have created notifevent and broadcasted it succesfully, but no idea what to do ahead, can anyone please help me with it or guide me.
1条回答 默认 最新
- douju2053 2016-08-08 18:03关注
- You should have a
NodeJS
andsocket.io
, install it on your server - When have event, use
Redis
to hold your variable and send it to yourNodeJs
or Use this PHP Library, you can send variable fromPHP
toNodeJS
Server: http://elephant.io/ - Data Processing on the
NodeJs
- Return it to PHP Webpage use
Socket.io (client javascript)
to catch this event and display for end-user (usingemit
andon
)
You can follow this instruction with
elephant.io
: Using PHP with Socket.ioor that with
Redis
: https://github.com/laracasts/Laravel-Redis-and-Socket.ioYou should try two ways and feedback with new question if you stuck because your question is unclear and very hard to answer
You can use
javascript
send Ajax Request and get variable fromPHP
and use this variable to make asocket.emit
but this way is less security, you must usetoken
or anything like this if you want to public your website本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报 - You should have a
悬赏问题
- ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
- ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
- ¥15 CSAPPattacklab
- ¥15 一直显示正在等待HID—ISP
- ¥15 Python turtle 画图
- ¥15 关于大棚监测的pcb板设计
- ¥15 stm32开发clion时遇到的编译问题
- ¥15 lna设计 源简并电感型共源放大器
- ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
- ¥15 Vue3地图和异步函数使用