Skip to content

Forward Together

我们先明确一下,我科学上网的目的主要是为了学习、工作、交友、查资料、和丰富自己的眼界,不是为了看黄片,或是干一些非法、政治或是见不得人的事。 1

Where we got reset

  1. (Chrome) Browser
  2. pip install
  3. gem install
  4. mvn package or gradlew build
  5. go get
  6. cargo build
  7. android update sdk --no-ui 现在 android 命令已经被 sdkmanager 取代。
  8. bitnami discourse installer, discourse/INSTALL-cloud.md

Ways to stay connected

System level

  1. haoel/haoel.github.io
  2. Outline
  3. Google Fi

Application level

Cli

export http_proxy=http://$PROXY_HOST:$PROXY_PORT https_proxy=http://$PROXY_HOST:$PROXY_PORT'
export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"

或者 http_proxy=http://$PROXY_HOST:$PROXY_PORT https_proxy=http://$PROXY_HOST:$PROXY_PORT command

Firefox

设置,网络设置,自动代理设置地址 填 https://example.com/secret-proxy.pac

服务器使用 caddyserver/forwardproxy

Caddyfile

https://example.com { # <!-- markdownlint-disable MD034-->
    tls fullchain.cer example.com.key

    forwardproxy {
        basicauth user pass
        probe_resistance secret.localhost
        serve_pac /secret-proxy.pac
        hide_ip
    }
}

Twidere

设置,网络,代理类型选 reverse proxy,代理主机设置为 https://example.com/[SCHEME]/[AUTHORITY]/[PATH][?QUERY][#FRAGMENT]

服务器可以直接用 Nginx, 配置如下,注意服务器 dns 必须可用

nginx.conf

resolver 8.8.8.8 valid=300s;
resolver_timeout 10s;
upstream twitter_userstream {
    # [nginx docs](https://www.nginx.com/blog/dns-service-discovery-nginx-plus/)
    server userstream.twitter.com:443 max_fails=10 fail_timeout=300;
    keepalive 300;
}

server {
    listen 443 ssl http2;
    ssl_certificate /path/to/signed_cert_plus_intermediates;
    ssl_certificate_key /path/to/private_key;
    # [Mozilla SSL Configuration Generator](https://ssl-config.mozilla.org/#server=nginx&server-version=1.17.0&config=modern)

    # [config](https://github.com/TwidereProject/Twidere-Android/issues/725#issuecomment-292864370)
    location ~ ^/(http|https)/([^/]+)/(.*) {
        proxy_pass $1://$2/$3$is_args$args;
        proxy_cookie_domain ~.* $server_name;
        proxy_cookie_path $uri /$2/uri;
        proxy_buffering off; # Turn off buffer in order to get stream as-is
        proxy_set_header Host $2;
        proxy_http_version 1.1; # This was necessary!!!
    }

    # [gist](https://gist.github.com/mariotaku/f1d61ec9cded3b0ed01f049bb5ddd840)
    location ~ ^/userstream\.twitter\.com/(.*) {
        proxy_pass https://twitter_userstream/$1$is_args$args;
        proxy_cookie_domain twitter.com $server_name;
        proxy_buffering off; # Turn off buffer in order to get stream as-is
        proxy_set_header Host userstream.twitter.com;
        proxy_http_version 1.1; # This was necessary!!!
    }

    location ~ ^/([\w\d-_]+)\.twitter\.com/(.*) {
        proxy_pass https://$1.twitter.com/$2$is_args$args;
        proxy_cookie_domain twitter.com $server_name;
    }

    location ~ ^/twitter\.com/(.*) {
        proxy_pass https://twitter.com/$2$is_args$args;
        proxy_cookie_domain twitter.com $server_name;
    }
}

Telegram

设置, 数据和存储,代理设置 里添加代理。

服务器使用官方 TelegramMessenger/MTProxy ,记得设置--domain 和--nat-info(如果需要的话)。安装可以参考 Interactive MTProto proxy installer

大致运行命令 mtproto-proxy --http-ports 443 --mtproto-secret SECRET --aes-pwd proxy-secret proxy-multi.conf -v --domain example.com --port 8888 -P PASSWORD

更多请参考 On Telegram.

Comments