Skip to content

Instantly share code, notes, and snippets.

View corvofeng's full-sized avatar
Do You Want To Build A Snowman.

corvofeng corvofeng

Do You Want To Build A Snowman.
View GitHub Profile
@corvofeng
corvofeng / http-unix.go
Last active July 21, 2022 05:36
forward http request to unix socket
package main
import (
"log"
"net"
"net/http"
"net/http/httputil"
"net/url"
)
// From: https://stackoverflow.com/a/26224019/5563477
@corvofeng
corvofeng / main.go
Created June 26, 2022 08:12
github device token
package main
// Refer to:
// https://github.com/golang/oauth2/pull/356/files/7cf8880eb1e002ce6fb90ffadae90b41452462e3
// https://docs.github.com/cn/developers/apps/building-oauth-apps/authorizing-oauth-apps#device-flow
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"