<html><head><style>p{margin-top:0px;margin-bottom:0px;}</style></head><body><div style="font-size:10pt; font-family:Gulim, sans-serif;"><p>Hello, nginx team.</p><p> </p><p>I'm using nginx as reverse proxy .</p><p>I'm trying to make nginx plugin module(I'm noob of this) for some purpose .</p><p>I have back-server opening websocket behind nginx .</p><p>client <-> nginx(reverse proxy) <-> back-server(websocket)</p><p>back-server is listening 3 numbers of websocket.</p><p>- websocket(A)</p><p><span style="font-size: 13.3333px;">- websocket(B)</span> </p><p><span style="font-size: 13.3333px;">- websocket(C)</span> </p><p><span style="font-size: 13.3333px;">I'd like to watch websocket(only A) connection status(connection fail/opened/closed) in nginx plugin module for some purpose.</span></p><p><span style="font-size: 13.3333px;">i can catch the request websocket 'A' connection in nginx plugin module by registering </span><code style="text-align: justify; background-color: rgb(255, 255, 255);">NGX_HTTP_ACCESS_PHASE</code><span style="font-family: sans-serif; font-size: medium; text-align: justify; background-color: rgb(255, 255, 255);"> </span><span style="font-size: 13.3333px;">handler(parse header and compare subprotocol(A) of http request).</span></p><p><span style="font-size: 13.3333px;">Query :</span></p><p><span style="font-size: 13.3333px;">Now, how can i get the </span><span style="font-size: 13.3333px;">websocket connection status(connection fail/opened/closed) event with the same http request context getting from </span><code style="text-align: justify; background-color: rgb(255, 255, 255);">NGX_HTTP_ACCESS_PHASE</code><span style="font-family: sans-serif; font-size: medium; text-align: justify; background-color: rgb(255, 255, 255);"> </span><span style="font-size: 13.3333px;">handler ?</span></p><p><span style="font-size: 13.3333px;">scenario : </span></p><p><span style="font-size: 13.3333px;"> 1. get websocket(A) connection request in nginx plugin module .</span></p><p><span style="font-size: 13.3333px;"> 2. catch event in nginx plugin moudle when the request failed / opened and closed .</span></p><p><span style="font-size: 13.3333px;"> 3. when the connection is opened or closed,i do some work .</span></p><p><span style="font-size: 13.3333px;">More query :</span></p><p><span style="font-size: 13.3333px;">Is the context from </span><code style="text-align: justify; background-color: rgb(255, 255, 255);">NGX_HTTP_ACCESS_PHASE</code><span style="font-family: sans-serif; font-size: medium; text-align: justify; background-color: rgb(255, 255, 255);"> </span><span style="font-size: 13.3333px;">handler valid until websocket connection closed?  (</span><span style="background-color: rgb(255, 255, 255); font-size: 13.3333px;">ngx_http_foo_handler(ngx_http_request_t *r) <- context r )</span></p><p><span style="font-size: 13.3333px;">If not , is there another context valid from http-requested to websocket connection closed?  </span></p><p><span style="font-size: 13.3333px;"> </span></p><p><span style="font-size: 13.3333px;">API & simple sample code will be very helpful .</span></p><p> </p><p>Thank you for your support</p></div></body></html><table style='display:none'><tr><td><img src="https://mail.naver.com/readReceipt/notify/?img=6f%2B9br%2B5WrclFomsaxC5FzJvMqgdpxg9M6UlpoMdaxC0pAgrF4MrFqblFuIo%2BrkSKAu%2F74lR74l4b4u516YQarlN16l%2FtzlN16l%2F74eZpm%3D%3D.gif" border="0"/></td></tr></table>