Skip to content

Instantly share code, notes, and snippets.

View dilfish's full-sized avatar

dilfish dilfish

View GitHub Profile
@dilfish
dilfish / qpack.go
Created February 2, 2021 08:54
decode HEADERS of HTTP3
package main
import (
"encoding/hex"
"log"
"github.com/marten-seemann/qpack"
)
func DecodeQPack() error {
@dilfish
dilfish / svcb.go
Last active April 23, 2023 02:30
dig svcb dns type
package main
import (
"errors"
"flag"
"fmt"
"log"
"github.com/miekg/dns"
)
@dilfish
dilfish / fake_conn_ls.go
Last active September 9, 2021 06:51
fake conn and ls in golang
package main
import (
"crypto/tls"
"log"
"net"
"net/http"
"time"
)
@dilfish
dilfish / genesis_public_key
Last active March 3, 2018 02:46
for genesis token
04131ba73eb7a293a48788bb08d8fe1a18f0ab5d0169e852779fd669240c03ed4d5c0b8b1a2c73a639c7f541b82d663dcf6a27870a201b152328de146eec67b150;shijiayun
@dilfish
dilfish / nn_pipe.c
Created September 1, 2014 14:49
nanomsg 里的 nn_pipe 是这样的
// Let's see Mr Sustrik's masterpiece
// He must like hierarchy and cleanness to death.
// So he defined an empty struct of nn_pipe to represent a
// concept of connection.
// I've known this trick for a while and never thought it could
// be used like this
// Sean at Shaanxi
// 20140901
last edit: 20140822 15:11
本文分析的代码是 nanomsg-0.4-beta版本。
要创建一个 PUB/SUB 服务,只需要六个 API,分别是:
1. nn_socket
2. nn_bind
3. nn_connect
4. nn_send
5. nn_recv
6. nn_close