Introduction to the

Hyperf-im is a chat room based on hyperF microservice coroutine framework and Layim web chat system.

Experience the address

hyperf-im im.jayjay.cn

function

Github

hyperf-im

  • Login registration (Http)
  • Single sign-on (Websocket)
  • Websocket
  • Group chat (Websocket)
  • Number of online users (Websocket)
  • Get unread messages (Websocket)
  • Friend Status (Websocket)
  • Handshake Authentication (Websocket)
  • Friend Lookup Add Consent reject (Http+Websocket)
  • Group create lookup Add Consent reject (Http+Websocket)
  • Chat record storage
  • The heartbeat detection
  • Resend the message
  • Break line reconnection
  • Send pictures and documents

Requirement

  • PHP 7.2 +
  • Swoole 4.4.16 +
  • Composer
  • Hyperf > = 1.1 x

Deployment way

Composer

composer updateCopy the code

Env configuration

vim .env

WS_URL=wss://im.jayjay.cn/im
APP_URL=https://im.jayjay.cn
STORAGE_IMG_URL=
STORAGE_FILE_URL=Copy the code


Nginx configuration

server{
 listen 80;
    server_name im.jayjay.cn;
    return 301 https://$server_name$request_uri;
}

server{
 listen 443 ssl;
    root /data/wwwroot/;
    add_header Strict-Transport-Security "max-age=31536000"; server_name im.jayjay.cn; access_log /data/wwwlog/im.jayjay.cn.access.log; error_log /data/wwwlog/im.jayjay.cn.error.log; client_max_body_size 100m; ssl_certificate /etc/nginx/ssl/full_chain.pem; ssl_certificate_key /etc/nginx/ssl/private.key; ssl_session_timeout 5m; Ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:! aNULL:! MD5:! RC4:! DHE; Location / {proxy_pass http://127.0.0.1:9501; proxy_set_header Host$host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Real-PORT $remote_port;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /im {proxy_pass http://127.0.0.1:9502; Proxy_http_version 1.1; proxy_read_timeout 3600s; proxy_set_header Upgrade$http_upgrade;
        proxy_set_header Connection "upgrade"; } location ~ .*\.(js|ico|css|ttf|woff|woff2|png|jpg|jpeg|svg|gif|htm)$ { root /data/wwwroot/IM/public; }}Copy the code

Start

  • hang
php bin/hyperf.php startCopy the code

TODO

1. Improve the overall project 2. Join weBRTC (video chat)


Hyperf-im open source now! Based on hyperF microservice framework + Layim development of a chat system!


My official group click here. Link to join the group chat [PHP/ Web/advanced Learning exchange group], study together, discuss with each other.

The group has been managed to organize the knowledge system (source code, learning video and other information), welcome to add group for free.


Swoole is a fantastic PHP tutorial that is no slut on the market. PHP is as good a web developer as any other language, and Swoole makes it even better. Enter the communication, Internet of things industry to develop Baidu Map, Baidu order center, tiger tooth, zhanqi TV and so on! After the winter layoff period is the period of the expansion of the recruitment of large enterprises, now the market is flooded with primary programmers, advanced middle and senior programmers are absolutely the talent urgently needed by large enterprises, this learning course is suitable for those within 1-5 years of PHP developers are in a bottleneck period, want to break through their advanced middle and senior architects! Seats are limited, first come, first served!

Tencent T3-T4 standard boutique PHP architect tutorial directory directory, as long as you finish the guarantee salary rise a step (continue to update)


Screenshots of some materials:

And limited-time premium benefits:

Tencent Senior PHP engineer written test topic

★ Deal with orders of 100 million level PV with high concurrency

★ Laravel develops tmall component services

Combat FLAG TV live video architecture project combat

Scan the qr code below to get it

For those who are interested in PHP backend technology and PHP architecture technology, my official group click here to learn and discuss with each other.

The group has been managed to organize the knowledge system (source code, learning video and other information), welcome to add group for free.

This course is deeply standardized to Tencent T3-T4 standard, and builds a learning plan for web developers to advance middle and senior level and architects to improve technology, and for their own value-added and salary increase! If you join BAT special training camp, you can also get the quota and GO language learning permission!!