diff --git a/examples/aws-companion/server.cjs b/examples/aws-companion/server.cjs index a0edb6b16..bcbc1e025 100644 --- a/examples/aws-companion/server.cjs +++ b/examples/aws-companion/server.cjs @@ -66,4 +66,4 @@ const server = app.listen(3020, () => { console.log('listening on port 3020') }) -companion.socket(server) +companion.socket(server, options) diff --git a/examples/companion/server/index.js b/examples/companion/server/index.js index ab7c5f6ee..351737c7d 100644 --- a/examples/companion/server/index.js +++ b/examples/companion/server/index.js @@ -71,7 +71,7 @@ app.use((err, req, res) => { res.status(500).json({ message: err.message, error: err }) }) -companion.socket(app.listen(3020)) +companion.socket(app.listen(3020), companionOptions) console.log('Welcome to Companion!') console.log(`Listening on http://0.0.0.0:${3020}`) diff --git a/packages/@uppy/companion/README.md b/packages/@uppy/companion/README.md index 30e37e963..eebdb77f9 100644 --- a/packages/@uppy/companion/README.md +++ b/packages/@uppy/companion/README.md @@ -68,7 +68,10 @@ on, you call the `socket` method like so. // ... const server = app.listen(PORT) -companion.socket(server) +// Pass the same `options` object you passed to `companion.app(options)` — +// `companion.socket` needs `options.server` to compute the external base path +// for incoming WS URLs (important behind reverse proxies). +companion.socket(server, options) ``` ### Run as standalone server