diff --git a/lib/upgrade.js b/lib/upgrade.js
index <HASH>..<HASH> 100644
--- a/lib/upgrade.js
+++ b/lib/upgrade.js
@@ -82,7 +82,7 @@ function upgradeHandler(req, socket) {
   // format headers
   socket.fullUrl = util.getFullUrl(socket).replace('http', 'ws');
   var isWs = WS_RE.test(headers.upgrade);
-  getPluginNameByReq(isWs ? null : req, function(err, uiPort) {
+  getPluginNameByReq(isWs ? req : null, function(err, uiPort) {
     if (err) {
       return socket.write(err);
     }
feat: support for using websocket to connect plugin ui server