Skip to content

Instantly share code, notes, and snippets.

@alibo
Last active December 8, 2023 22:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alibo/9f157e2f9b1e4d462bceddf117811214 to your computer and use it in GitHub Desktop.
Save alibo/9f157e2f9b1e4d462bceddf117811214 to your computer and use it in GitHub Desktop.
shecan.ir proxy (sni, http, tcp) servers
IP Date
50.7.87.2 Jan 9 2023
50.7.87.3 Jan 9 2023
50.7.87.4 Jan 9 2023
50.7.87.5 Jan 9 2023
50.7.87.6 Jan 9 2023
50.7.85.34 Jan 9 2023
50.7.85.35 Jan 9 2023
50.7.85.37 Jan 9 2023
50.7.85.38 Jan 9 2023
204.12.224.146 Jan 30 2023
204.12.224.147 Jan 30 2023
204.12.224.148 Jan 30 2023
204.12.224.149 Jan 30 2023
204.12.224.150 Jan 30 2023
50.7.87.82 April 5 2023
50.7.87.83 April 5 2023
50.7.87.84 April 5 2023
50.7.87.85 April 5 2023
50.7.87.86 April 5 2023
50.7.85.218 April 5 2023
50.7.85.219 April 5 2023
50.7.85.220 April 5 2023
50.7.85.221 April 5 2023
50.7.85.222 April 5 2023
@alibo
Copy link
Author

alibo commented Jan 9, 2023

Direct Usage

  1. curl --resolve
curl --resolve 'developer.android.com:443:50.7.87.2' https://developer.android.com -H 'Host: developer.android.com' -v 
  1. /etc/hosts:
50.7.87.2 developer.android.com
# ...
  1. CoreDNS + host plugin
.:53 {
    bufsize 512
    errors
    log . {
        class all
    }
    health {
        lameduck 20s
    }

    hosts {
        50.7.87.2 developer.android.com
        fallthrough
    }

    forward . 178.22.122.100 185.51.200.2
    cache 900

    reload
    minimal
}
  1. Golang: custom client with custom transport
package main

import (
	"io/ioutil"
	"log"
	"math/rand"
	"net"
	"net/http"
	"time"
)

var shecanServers = []string{
	"50.7.87.2",
	"50.7.87.3",
	"50.7.87.4",
	"50.7.87.5",
	"50.7.87.6",
	"50.7.85.34",
	"50.7.85.35",
	"50.7.85.37",
	"50.7.85.38",
}

func main() {
	rand.Seed(time.Now().Unix())

	req, err := http.NewRequest(http.MethodGet, "https://developer.android.com", nil)
	if err != nil {
		log.Fatalf("client: could not create request: %s\n", err)
	}

	client := shecanClient()

	res, err := client.Do(req)
	if err != nil {
		log.Fatalf("client: error making http request: %s\n", err)
	}

	log.Printf("client: got response!\n")
	log.Printf("client: status code: %d\n", res.StatusCode)

	resBody, err := ioutil.ReadAll(res.Body)
	if err != nil {
		log.Fatalf("client: could not read response body: %s\n", err)
	}
	log.Printf("client: response body: %s\n", resBody)

}

func shecanClient() *http.Client {
	return &http.Client{
		Transport: &http.Transport{
			Dial: func(network, addr string) (net.Conn, error) {
				i := rand.Intn(len(shecanServers))
				return net.Dial(network, shecanServers[i]+":443")
			},
		},
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment