location =/websocket { push_stream_subscriber websocket; # websocket push_stream_channels_path $arg_id; # websocket id push_stream_websocket_allow_publish on; # - push_stream_client_subscribed_request /subscribe; # push_stream_client_unsubscribed_request /unsubscribe; # push_stream_client_publish_request /publish; # websocket }
location =/subscribe { internal; postgres_pass ngx; # PostgreSQL set_quote_json_str $channel $arg_id; # postgres_query "listen $channel"; # }
location =/unsubscribe { internal; postgres_pass ngx; # PostgreSQL set_quote_json_str $channel $arg_id; # postgres_query "unlisten $channel"; # }
location =/publish { internal; postgres_pass ngx; # PostgreSQL postgres_query "select now()"; # PostgreSQL websocket }
location =/publisher { allow 127.0.0.1/16; # deny all; # push_stream_channel_info_on_publish off; # push_stream_publisher; # push_stream_channels_path $arg_id; # websocket id }
Source: https://habr.com/ru/post/456672/
All Articles