diff --git a/lib/utilsBundle.js b/lib/utilsBundle.js
index 7dd8831f29c19f2e20468508b77b0a3f9d204ae6..c50a1ac2b3439a5b2fbf8afa61c369360710071f 100644
--- a/lib/utilsBundle.js
+++ b/lib/utilsBundle.js
@@ -59,7 +59,7 @@ const program = require("./utilsBundleImpl").program;
 const ProgramOption = require("./utilsBundleImpl").ProgramOption;
 const progress = require("./utilsBundleImpl").progress;
 const SocksProxyAgent = require("./utilsBundleImpl").SocksProxyAgent;
-const ws = require("./utilsBundleImpl").ws;
+const ws = "Bun" in globalThis ? require("ws") : require("./utilsBundleImpl").ws;
 const wsServer = require("./utilsBundleImpl").wsServer;
 const wsReceiver = require("./utilsBundleImpl").wsReceiver;
 const wsSender = require("./utilsBundleImpl").wsSender;
