Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/KenmyZhang/okex-websocket
eqs是一个包括火币(Huobipro),币安(Binance),,Ok(Okex)等在内的各头部交易所的实时行情爬虫,使用websocket对接,实时获取最新行情
go get okex-websocket
package main
import (
"fmt"
"okex-websocket/eqsModels"
"okex-websocket/exchange/huobipro"
)
func main() {
symbol := eqsModels.EqsSymbol{
Base: "BTC",
Quote: "USDT",
Sep: "/",
}
// 使用默认host, 需要科学上网
//huobiproConn := huobipro.NewDefauldHuobiproWsConn(symbol, "001")
huobiproConn := huobipro.NewHuobiproWsConnWithHost("wss", "api.huobi.me", symbol, "001")
go huobiproConn.StartMarketDetail()
// 获取行情数据
go func() {
for {
outData := <-huobiproConn.OutChan
data := outData.(huobipro.HuobiproMarketDetail)
fmt.Printf("%+v\n", data)
}
}()
// 获取报错信息
go func() {
for {
fmt.Println(<-huobiproConn.ErrChan)
}
}()
select {}
}
package main
import (
"fmt"
"okex-websocket/eqsModels"
"okex-websocket/exchange/okex"
)
func main() {
symbol := eqsModels.EqsSymbol{
Base: "BTC",
Quote: "USDT",
Sep: "/",
}
okexConn := Okex.NewOkexWsConnWithHost("wss","real.okex.com:8443", symbol)
go okexConn.StartSpotTrade()
// 获取行情数据
go func() {
for {
outData := <-okexConn.OutChan
data := outData.(Okex.OkexSpotTrade)
fmt.Printf("%+v\n", data)
}
}()
// 获取报错信息
go func() {
for {
fmt.Println(<-okexConn.ErrChan)
}
}()
select {}
}
package main
import (
"fmt"
"okex-websocket/eqsModels"
"okex-websocket/exchange/binance"
)
func main() {
symbol := eqsModels.EqsSymbol{
Base: "BTC",
Quote: "USDT",
Sep: "/",
}
binanceConn := binance.NewDefauldBinanceWsConn(symbol)
go binanceConn.StartTrade()
// 获取行情数据
go func() {
for {
outData := <-binanceConn.OutChan
data := outData.(binance.BinanceTrade)
fmt.Printf("%+v\n", data)
}
}()
// 获取报错信息
go func() {
for {
fmt.Println(<-binanceConn.ErrChan)
}
}()
select {}
}
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.