14 Commits

Author SHA1 Message Date
tt2468
b9a63603c7 websocketserver: Validate op field type
Could cause a crash by assuming `op` is always a number.

Closes #965
2022-07-25 08:00:48 -07:00
tt2468
711746524c Revert "Config, websocketserver: Add feature to bind to loopback (default)"
This reverts commit 1da0214201f96e6e53dfa88701cb8f3721946bde.
2022-06-07 23:07:09 -07:00
tt2468
e04bca0993 Revert "forms: Add configuration to enable external access"
This reverts commit 1cd12c10237a388288250820227d05800f40f064.
2022-06-07 22:34:40 -07:00
tt2468
6deadc25ac base: Change column limit to 132
A column limit of 80 is very restrictive and code readability was
suffering. A limit of 132 is more realistic for this plugin.
2022-06-07 21:36:51 -07:00
tt2468
f73e78582b base: Format code 2022-05-13 21:19:29 -07:00
tt2468
1cd12c1023 forms: Add configuration to enable external access
After discussion in the Discord server, and some internal discussion,
this was deemed a reasonable patch for various security concerns. This
basically controls whether obs-websocket binds to 127.0.0.1 or 0.0.0.0.

I decided to have obs-websocket bind to 127.0.0.1 by default, since
most users appear to be using obs-websocket on the same machines as
their client software. This will be changed if it poses significant
support-related issues.

Further security solutions have been discussed, but are either a heavy
amount of work, or significantly impact client applications' connect
flows.

One idea that I should mention is like a cookie system, where:
- On first connect, obs-websocket asks the user to approve the
connection.
- After authentication, obs-websocket gives the client a token in the
`Identified` message, which the client stores.
- On future connects, the client uses this token, along with the
password, to authenticate without needing user confirmation.

This system will likely be implemented in a future version of
obs-websocket.

Closes #907
2022-04-26 03:24:26 -07:00
tt2468
1da0214201 Config, websocketserver: Add feature to bind to loopback (default)
Binds to localhost or 127.0.0.1 by default, since most users don't have
to access obs-websocket externally.
2022-04-25 21:31:52 -07:00
Chris Tallon
3a5f0d89b9 Server: Add --websocket_ipv4_only switch
Socket listening default changed to IPv4 and IPv6,
overridable to IPv4 only by using the command line switch.
2022-04-25 19:53:15 -07:00
tt2468
0f6ee87f99 WebSocketServer: [BREAKING] Remove ignoreInvalidMessages identify param
This parameter is a weird one. With the abstraction of requests from
the underlying websocket protocol, there theoretically should be no
need to ignore invalid messages, because the implementation of the
low-level protocol on clients should be solid, with the requests
themselves not being fatal to the session.

As such, I consider this to be feature bloat, with lots of messy code
attributed to it.
2021-12-15 02:41:37 -08:00
tt2468
fab56d71ea WebSocketServer: Get config values directly from Config
We were previously storing config values in the WebSocketServer class
itself, in a weak attempt at modularity. It's better to give up on that
idea and just get it from the Config object itself.
2021-12-15 02:06:52 -08:00
tt2468
2e079ad681 WebSocketServer: Various code cleanup 2021-11-21 01:37:21 -08:00
tt2468
32a9e12f62 Base: Logging improvements
Use blog_debug() in place of almost all debug logging messages, and
change some log levels to be less verbose.
2021-11-20 01:50:49 -08:00
tt2468
bd6c663775 Base: Add copyright header to source 2021-11-19 17:32:22 -08:00
tt2468
5ab091a40b Base: Move WebSocketServer to its own directory
Just helps with organization
2021-11-18 00:29:28 -08:00