
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
github.com/BufferZoneCorp/net-helper
Advanced tools
net-helper is a lightweight Go package (netutil) that wraps net/http and net with context-aware helpers for common network operations: typed HTTP GET/POST, reachability probing, and local IP discovery.
The package has no external dependencies and works as a thin convenience layer on top of the standard library.
go get github.com/BufferZoneCorp/net-helper
import "github.com/BufferZoneCorp/net-helper/netutil"
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"time"
"github.com/BufferZoneCorp/net-helper/netutil"
)
func main() {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
// Simple GET — returns body bytes and status code
body, status, err := netutil.Get(ctx, "https://httpbin.org/get")
if err != nil {
log.Fatal(err)
}
fmt.Printf("status %d, %d bytes\n", status, len(body))
// POST with a JSON-serialisable payload
type payload struct {
Name string `json:"name"`
Score int `json:"score"`
}
resp, status, err := netutil.Post(ctx, "https://httpbin.org/post", payload{Name: "alice", Score: 42})
if err != nil {
log.Fatal(err)
}
var result map[string]interface{}
json.Unmarshal(resp, &result)
fmt.Println("posted, status:", status)
// Check whether a host is reachable before making real requests
if netutil.IsReachable("api.example.com:443", 2*time.Second) {
fmt.Println("endpoint is up")
}
// Discover the local outbound IP
fmt.Println("local IP:", netutil.LocalIP())
}
| Function | Signature | Description |
|---|---|---|
Get | (ctx context.Context, url string) ([]byte, int, error) | Context-aware HTTP GET; returns body, status code, error |
Post | (ctx context.Context, url string, payload interface{}) ([]byte, int, error) | JSON-encode payload and POST; returns body, status code, error |
IsReachable | (addr string, timeout time.Duration) bool | TCP dial to host:port within timeout; returns true if connected |
LocalIP | () string | Return the preferred outbound local IP address |
MIT — see LICENSE.
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
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.