obs-websocket icon indicating copy to clipboard operation
obs-websocket copied to clipboard

websocketserver: Allow the user to bind to a specific address

Open silasary opened this issue 11 months ago • 3 comments

Description

This PR adds a config variable and command line argument for binding the websocket server to a specific address, rather than blindly listening on all interfaces. This PR does not currently add a GUI element to configure this.

By default, OBS will continue listening on all addresses, this just adds the option to reduce the exposure for users who want or need it (changing the default appears to be the main reason 1cd12c10237a388288250820227d05800f40f064 was reverted).

I have chosen to allow binding of a specific address instead of a "localhost only" flag, as it's more flexible for users with multiple network adaptors.

No UI changes just yet, because I'm not sure how to best expose it in a UI, and feel like the users who want/need it are probably comfortable with hand-editing the config or using the CLI argument.

Motivation and Context

I am trying to use OSB websockets in an environment where listening on all addresses is a problem. This allows me to bind OBS to only one network adaptor. This PR also addresses the security concerns of #907, allowing the user to bind to 127.0.0.1 or ::1.

How Has This Been Tested?

Modified config file, tried connecting to the socket from local machine and remote machine. Reset config file, then repeated test with command line argument. Also conducted test without any config changes to ensure default was still 0.0.0.0

Tested OS(s): Windows 10, Windows 11

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New request/event (non-breaking)

Checklist:

  • [x] I have read the Contributing Guidelines.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] My code is not on master or a release/* branch.
  • [x] The code has been tested.
  • [ ] I have included updates to all appropriate documentation.

silasary avatar Jan 22 '25 07:01 silasary

Giving this a bump, as it has unresolved comments still. Looks like the feedback was acknowledged, but the requested changes have not been made yet.

Fenrirthviti avatar Mar 12 '25 17:03 Fenrirthviti

Thanks for the bump 😄

silasary avatar Mar 13 '25 04:03 silasary

Giving a bump because I would like this functionality

LinuxMainframe avatar Nov 06 '25 01:11 LinuxMainframe