
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
github.com/t-lin/go-libp2p-gostream
Go "net" wrappers for libp2p
Package gostream
allows to replace the standard net stack in Go with
LibP2P streams.
Given a libp2p.Host, gostream
provides Dial() and Listen() methods which
return implementations of net.Conn and net.Listener.
Instead of the regular "host:port" addressing, gostream
uses a Peer ID, and
rather than a raw TCP connection, gostream will use libp2p's net.Stream. This
means your connections will take advantage of libp2p's multi-routes, NAT
transversal and stream multiplexing.
This package is a library that uses Go modules for depedency management.
Documentation can be read at Godoc. The important bits follow.
A simple communication between peers -one acting as server and the other as client- would work like:
go func() {
listener, _ := Listen(srvHost, tag)
defer listener.Close()
servConn, _ := listener.Accept()
defer servConn.Close()
reader := bufio.NewReader(servConn)
msg, _ := reader.ReadString('\n')
fmt.Println(msg)
servConn.Write([]byte("answer!\n"))
}()
clientConn, _ := Dial(context.Background(), clientHost, srvHost.ID(), tag)
clientConn.Write([]byte("question?\n"))
resp, _ := ioutil.ReadAll(clientConn)
fmt.Println(resp)
Note error handling above is ommited.
PRs accepted.
MIT © Protocol Labs, Inc.
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
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.