{"id":47393,"library":"detox-server","title":"Detox Server","description":"WebSocket proxy server for Detox, the gray-box end-to-end testing library for mobile apps. Version 7.0.0 is current and maintained. It acts as a middleware between Detox tests and the mobile device, handling app connectivity and command proxying. Releases are coupled with Detox's release cycle, roughly monthly. Key differentiator: it is a lightweight, dedicated server component that simplifies test infrastructure by managing WebSocket connections and device sessions, unlike generic WebSocket servers that require manual setup.","status":"active","version":"7.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/wix/detox","tags":["javascript"],"install":[{"cmd":"npm install detox-server","lang":"bash","label":"npm"},{"cmd":"yarn add detox-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add detox-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"WebSocket library for server-client and server-device communication","package":"ws","optional":false}],"imports":[{"note":"DetoxServer is the default export. For CommonJS, use const DetoxServer = require('detox-server').","wrong":"const DetoxServer = require('detox-server').DetoxServer","symbol":"DetoxServer","correct":"import { DetoxServer } from 'detox-server'"},{"note":"startServer is a named export. In ESM, import { startServer } from 'detox-server'; in CJS, destructure from require('detox-server').","wrong":"const startServer = require('detox-server').startServer","symbol":"startServer","correct":"import { startServer } from 'detox-server'"},{"note":"DetoxServerOptions is a TypeScript type. Use import type for type-only imports to avoid runtime errors. Available in TypeScript v4.5+.","wrong":"import { DetoxServerOptions } from 'detox-server'","symbol":"DetoxServerOptions","correct":"import type { DetoxServerOptions } from 'detox-server'"}],"quickstart":{"code":"import { DetoxServer } from 'detox-server';\n\nconst server = new DetoxServer({\n  port: 8099,\n  log: 'verbose',\n});\n\nserver.start().then(() => {\n  console.log('Detox server listening on port 8099');\n});","lang":"typescript","description":"Initialize and start a Detox server on port 8099 with verbose logging."},"warnings":[{"fix":"Remove 'host' option from DetoxServer constructor.","message":"In v7, the DetoxServer constructor no longer accepts a 'host' option; use 'port' only. See migration guide.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Use async/await or .then() instead of callbacks.","message":"The method 'start()' now returns a Promise instead of calling a callback. Old callback style is deprecated.","severity":"deprecated","affected_versions":">=6.0.0"},{"fix":"For TLS, configure a reverse proxy (e.g., nginx) to terminate TLS.","message":"Detox server only supports WebSocket connections; ensure clients connect via ws:// (not TLS) unless configured.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'7.0.0':22 'act':28 'app':20,40 'box':11 'command':43 'compon':63 'connect':41,71 'coupl':47 'current':24 'cycl':52 'dedic':61 'detox':1,7,33,49 'devic':38,73 'differenti':56 'end':13,15 'end-to-end':12 'generic':76 'gray':10 'gray-box':9 'handl':39 'infrastructur':67 'javascript':83 'key':55 'librari':17 'lightweight':60 'maintain':26 'manag':69 'manual':81 'middlewar':31 'mobil':19,37 'month':54 'proxi':4,44 'releas':45,51 'requir':80 'rough':53 'server':2,5,62,78 'session':74 'setup':82 'simplifi':65 'test':16,34,66 'unlik':75 'version':21 'websocket':3,70,77","created_at":"2026-06-07T16:51:18.399714+00:00","updated_at":"2026-06-07T16:51:18.399714+00:00","problems":[{"fix":"Kill the process using port 8099 or change the port in DetoxServer constructor.","cause":"Port 8099 is already occupied by another process (e.g., another Detox server or application).","error":"Error: listen EADDRINUSE: address already in use :::8099"},{"fix":"Use default import: import DetoxServer from 'detox-server' (ESM) or const DetoxServer = require('detox-server') (CJS).","cause":"Importing DetoxServer incorrectly (e.g., as a default import from a named export).","error":"TypeError: DetoxServer is not a constructor"},{"fix":"Run npm install ws or add 'ws' to your package.json dependencies.","cause":"Missing peer dependency 'ws'.","error":"Error: Cannot find module 'ws'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/wix/detox#readme","github":"https://github.com/wix/detox","docs":null,"changelog":null,"pypi":null,"npm":"detox-server","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}