Update .gitignore and untrack files

This commit is contained in:
lzx 2025-08-01 11:33:23 +08:00
parent 16e1e4096e
commit 1af2d6f0c1
4 changed files with 3 additions and 42 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
./cmd/proxy
./cmd/config.json
./main.go
cmd/proxy
cmd/config.json
.main.go

View File

@ -1,6 +0,0 @@
{
"coin": "alph",
"zmqAddr": "amqp://guest:guest@localhost:5672/",
"tcpAddr": "0.0.0.0:39002",
"proxyAddr": "alph.m2pool.com:33390"
}

BIN
cmd/proxy

Binary file not shown.

33
main.go
View File

@ -1,33 +0,0 @@
package main
import (
"fmt"
"log"
"time"
"github.com/zeromq/goczmq"
)
func main() {
// 绑定到指定地址(可以是本地或远程 IP
endpoint := "tcp://0.0.0.0:5555" // 本机所有 IP 可访问
sock, err := goczmq.NewPush(endpoint)
if err != nil {
log.Fatalf("Failed to create PUSH socket: %v", err)
}
defer sock.Destroy()
fmt.Println("PUSH socket bound to", endpoint)
// 定时发送消息
for i := 0; i < 1000; i++ {
msg := fmt.Sprintf("Hello %d", i)
err := sock.SendFrame([]byte(msg), goczmq.FlagNone)
if err != nil {
log.Printf("Send error: %v", err)
} else {
fmt.Println("Sent:", msg)
}
time.Sleep(1 * time.Second)
}
}