Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
github.com/christopher-dG/go-obs-websocket
obsws
provides client functionality for obs-websocket
.
Currently, the target version is 4.4
.
go get github.com/christopher-dG/go-obs-websocket
package main
import (
"log"
"time"
"github.com/christopher-dG/go-obs-websocket"
)
func main() {
// Connect a client.
c := obsws.Client{Host: "localhost", Port: 4444}
if err := c.Connect(); err != nil {
log.Fatal(err)
}
defer c.Disconnect()
// Send and receive a request asynchronously.
req := obsws.NewGetStreamingStatusRequest()
if err := req.Send(c); err != nil {
log.Fatal(err)
}
// This will block until the response comes (potentially forever).
resp, err := req.Receive()
if err != nil {
log.Fatal(err)
}
log.Println("streaming:", resp.Streaming)
// Set the amount of time we can wait for a response.
obsws.SetReceiveTimeout(time.Second * 2)
// Send and receive a request synchronously.
req = obsws.NewGetStreamingStatusRequest()
// Note that we create a new request,
// because requests have IDs that must be unique.
// This will block for up to two seconds, since we set a timeout.
resp, err = req.SendReceive(c)
if err != nil {
log.Fatal(err)
}
log.Println("streaming:", resp.Streaming)
// Respond to events by registering handlers.
c.AddEventHandler("SwitchScenes", func(e obsws.Event) {
// Make sure to assert the actual event type.
log.Println("new scene:", e.(obsws.SwitchScenesEvent).SceneName)
})
time.Sleep(time.Second * 10)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.