nchan.md - slideit€¦ · socket.io (Node.js) Lightstreamer (Java) Faye (Node.js and Ruby)......

Post on 17-Oct-2020

3 views 0 download

transcript

NCHAN WEB

Vincent 2017.3.7

name = 'Vincent'

real_name = ' '

company = ' - '

title = ' CTO Rubyist'

blog = 'https://xiewenwei.github.io'

github = 'https://github.com/xiewenwei'

ruby_china = 'https://ruby-china.org/vincent'

while true

write_programs

read_books

watch_movies

enjoy

end

IM

Nginx Nchan Nginx Nchan

& QA

IM IM

IM Client iOS Android Web

Web

Http

Socket

Websocket

1 HTTP

2 IM

3 WEBSOCKET - ACTIONCABLE

Rails 5 Rails Rails

ACTIONCABLE

ActionCable websocket serverruby

4 WEBSOCKET - NGINX NCHAN Nginx / pub/sub

NGINX NCHAN

/ pub/sub Web

Nginx Nginx

NCHAN

nchan application client websocket

application http pub nchan nchan client

WEBSOCKET

ActionCable (Ruby on Rails)socket.io (Node.js)Lightstreamer (Java)Faye (Node.js and Ruby)...

NCHAN

Restful API hook Websocket, EventSource Long Poll

LOAD BALANCING HTTP

LOAD BALANCING WEBSOCKETS

NCHAN LOAD BALANCING

NCHAN BENCHMARK

Nchan

BENCHMARK

ActionCable

NCHAN

Channel ID ID Websocket

location ~ /channels/(\w+)/sub$ { nchan_subscriber; nchan_channel_id "$1"; }

ID uuid hook token

location ~ /channels/(\w+)/sub$ { nchan_authorize_request /ws_authorize; #... } location = /ws_authorize { proxy_pass http://hook_demo/websockets/auth; proxy_set_header X-Channel-Id $nchan_channel_id; #... }

hook ID Redis Set Redis Set

hook ID Redis Set

Http

Websocket

Channel ID

Redis

...

Nchan Ngnix Web

Nchan

THANK YOU & QA Ruby

Nginx Nchan Rails ActionCable Real-time Web Applications with Ruby on RailsWebsocket Shootout: Clojure, C++, Elixir, Go, NodeJS, andRuby