Skip to content

Commit

Permalink
use new blog system
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Dec 1, 2023
1 parent 59913df commit 2e8f588
Show file tree
Hide file tree
Showing 24 changed files with 231 additions and 187 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM squidfunk/mkdocs-material:9.4.14 AS builder

RUN pip install jieba

ADD . /src

WORKDIR /src
Expand Down
6 changes: 6 additions & 0 deletions docs/blog/.authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
authors:
ginuerzh:
name: ginuerzh
description: Creator
avatar: https://avatars.githubusercontent.com/u/2801795
url: https://github.com/ginuerzh
1 change: 1 addition & 0 deletions docs/blog/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 博客
14 changes: 9 additions & 5 deletions docs/blog/2022/bypass.md → docs/blog/posts/bypass.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 30min
publish_date: 2022-08-27 12:00
authors:
- ginuerzh
categories:
- Bypass
readtime: 30
date: 2022-08-27
comments: true
---

# 流量控制-分流器

所谓的分流是指按照一定的规则对流量进行划分,再对划分后的流量执行相应的操作,以达到某种程度的流量控制。

Expand All @@ -16,6 +18,8 @@ comments: true
* 内网流量 - 例如访问公司内部服务器,这种流量只能在公司内网才有效,不能被转发到外网。
* 外网流量 - 例如访问外网服务,可能需要通过公司的代理服务器才能访问。

<!-- more -->

## GOST中的分流

GOST最早是在v2.6版本中增加了[分流](https://v2.gost.run/bypass/)的功能,可以通过设置一组分流规则来对流量进行划分,主要用在转发链上,根据请求的目标地址来确定路由规则。
Expand Down
17 changes: 12 additions & 5 deletions docs/blog/2022/deploy.md → docs/blog/posts/deploy.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 15min
publish_date: 2022-12-20 22:00
authors:
- ginuerzh
categories:
- Deploy
- Docker
- K8S
readtime: 15
date: 2022-12-20
comments: true
---

# 利用Traefik和Docker部署GOST服务

[Traefik](https://traefik.io/traefik/)是类似于Nginx的反向代理工具,其云原生的特性使其在Docker和Kubernetes环境下使用起来非常方便。

这里假设你的域名为`gost.run`,每个服务使用单独的子域名来路由,也可以使用URI路径来路由。

<!-- more -->

## Docker

由于Traefik和GOST都支持Docker容器化,因此这里直接采用Docker Compose来进一步简化部署流程。
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 15min
publish_date: 2022-05-03 12:17
authors:
- ginuerzh
categories:
- Bypass
readtime: 15
date: 2022-05-03
comments: true
---

# GOST v3动态分流功能的一种实现方式

原文地址:[https://groups.google.com/g/go-gost/c/b9Z0BcqUArw](https://groups.google.com/g/go-gost/c/b9Z0BcqUArw)

分流是指根据一定的规则让需要通过转发链的请求走转发链,不需要走转发链则绕过转发链。分流在GOST v3中通过分流器来实现(bypass),具体的使用方式可以参考https://gost.run/concepts/bypass/。
Expand All @@ -17,6 +20,8 @@ GOST v3中新增了一个记录器模块(https://gost.run/concepts/recorder/),

利用以上的特性,就可以实现类似与COW(https://github.com/cyfdecyf/cow)所提供的自动分流功能,默认情况下请求不使用转发链,当请求失败后切换为使用转发链。

<!-- more -->

目前的记录器可以记录所有访问失败的目标地址,将这些地址记录到redis中,再将分流器的数据源设置为redis中与记录器所记录的key相同,这样就可以通过记录器间接的找出并动态更新需要使用转发链的请求目标地址,提供给分流器使用。

```yaml
Expand Down
16 changes: 11 additions & 5 deletions docs/blog/2015/forward.md → docs/blog/posts/forward.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 5min
publish_date: 2015-12-23 22:28
authors:
- ginuerzh
categories:
- General
readtime: 5
date: 2015-12-23
comments: true
---

# 利用国内vps作为中间代理转发请求到国外vps

原文地址:[https://groups.google.com/g/go-gost/c/aLj9ruoSp4U](https://groups.google.com/g/go-gost/c/aLj9ruoSp4U)

国外的vps可以帮助我们科学上网,但使用时间长了,很可能会出现限流或不稳定的情况。
这时如果通过国内的vps作为中转,情况可能会有所改善。

<!-- more -->

这里假设国内vps地址是aliyun.com,国外vps地址是linode.com,有两种方法。

第一种可以称之为桥式:
Expand Down
14 changes: 9 additions & 5 deletions docs/blog/2023/gost-plus.md → docs/blog/posts/gost-plus.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 10min
publish_date: 2023-10-15 22:00
authors:
- ginuerzh
categories:
- Reverse Proxy
readtime: 10
date: 2023-10-15
comments: true
---

# GOST.PLUS-公共反向代理服务

[反向代理隧道](https://gost.run/tutorials/reverse-proxy-tunnel/)是GOST中新增的一个较大功能,同时也是一个很重要的功能,借助于反向代理和内网穿透,可以很方便的将内网Web服务暴露到公网,随时随地都能访问。

为了能够对此功能进行更全面的测试,同时也为了能够给需要临时暴露内网服务的用户提供一种快捷的方式,特公开推出`GOST.PLUS`公共反向代理测试服务。此服务面向所有用户开放,无需注册。

<!-- more -->

本服务以测试为主要目的,所有公共访问点均为临时访问点,有效期为24小时。

## 使用方法
Expand Down
16 changes: 11 additions & 5 deletions docs/blog/2015/gost.md → docs/blog/posts/gost.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 1min
publish_date: 2015-05-21 15:08
authors:
- ginuerzh
categories:
- General
readtime: 1
date: 2015-05-21
comments: true
---

# GOST - GO Simple Tunnel

原文地址:[https://groups.google.com/g/go-gost/c/vKbJh1IPK7o](https://groups.google.com/g/go-gost/c/vKbJh1IPK7o)

<!-- more -->

## GO语言实现的安全隧道

### 特性
Expand Down
17 changes: 11 additions & 6 deletions docs/blog/2015/lets.md → docs/blog/posts/lets.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 5min
publish_date: 2015-12-18 18:05
authors:
- ginuerzh
categories:
- General
readtime: 5
date: 2015-12-18
comments: true
---

原文地址:[https://groups.google.com/g/go-gost/c/32jXBP3pAxc](https://groups.google.com/g/go-gost/c/32jXBP3pAxc)
# 利用letsencrypt和gost搭建https代理

原文地址:[https://groups.google.com/g/go-gost/c/32jXBP3pAxc](https://groups.google.com/g/go-gost/c/32jXBP3pAxc)

[letsencrypt](https://letsencrypt.org/)在12月3号正式进行公测了,也就是说现在所有人都可以免费拥有自己的tls证书了,前提是服务器要绑定域名。

<!-- more -->

首先当然是要生成证书:

```bash
Expand Down
16 changes: 11 additions & 5 deletions docs/blog/2015/origin.md → docs/blog/posts/origin.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 5min
publish_date: 2015-10-26 09:39
authors:
- ginuerzh
categories:
- General
readtime: 5
date: 2015-10-26
comments: true
---

# GOST的起源以及应用场景

原文地址:[https://groups.google.com/g/go-gost/c/Cnh_4aeRVcg](https://groups.google.com/g/go-gost/c/Cnh_4aeRVcg)

gost的想法是在2013年产生的,那一年也是我来到当前这家公司的第一年,进入公司后发现公司对网络的限制已经到了极限:只能通过公司的代理访问网络,并且在未申请更高权限的情况下只能访问baidu搜索,其他网站一律被封,然而我们的小组又是搞移动互联网的,所以平时开发和查资料很不方面。

<!-- more -->

当时我们有一个Linode VPS用于开发,公司也放行了此VPS个别端口的HTTP访问权限,于是就开始寻思着能不能利用这个Linode中转一下。
其实需求很简单:通过公司的代理,在本地与linode之间建立一个tunnel。

Expand Down
16 changes: 11 additions & 5 deletions docs/blog/2017/redirect.md → docs/blog/posts/redirect.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 10min
publish_date: 2017-01-16 18:23
authors:
- ginuerzh
categories:
- VPN
readtime: 10
date: 2017-01-16
comments: true
---

# Linux下基于L2TP/IPSec + iptables + gost实现全局网络访问

原文地址:[https://groups.google.com/g/go-gost/c/bx0fYx2jmG4](https://groups.google.com/g/go-gost/c/bx0fYx2jmG4)

之前写过一篇[类似的文章](../2015/redirect.md),是利用PPTP + iptables + redsocks,但由于新版IOS上已经不支持PPTP了,所以这里面就换用IPSec来实现。

<!-- more -->

新版的gost也已经支持透明代理,redsocks也可以省去了,所以理论上这种方法要比之前的简单许多。

首先安装IPSec VPN服务,网上有人已经写了个自动化脚本,就不用我们费心再一步一步安装了:[https://github.com/hwdsl2/setup-ipsec-vpn](https://github.com/hwdsl2/setup-ipsec-vpn)
Expand Down
16 changes: 11 additions & 5 deletions docs/blog/2015/redirect.md → docs/blog/posts/redsocks.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 30min
publish_date: 2015-07-23 18:27
authors:
- ginuerzh
categories:
- VPN
readtime: 30
date: 2015-07-23
comments: true
---

# 利用PPTP, redsocks, iptables, https/socks5 proxy实现全局代理上网

原文地址:

[https://groups.google.com/g/go-gost/c/dzDQeTfNCjY](https://groups.google.com/g/go-gost/c/dzDQeTfNCjY)

[https://docs.google.com/document/d/1OGIrebKWq__Lt0ADxprxapevC1BEzPaR6ry9XY_WDdA/edit#heading=h.qh7wl45v71jq](https://docs.google.com/document/d/1OGIrebKWq__Lt0ADxprxapevC1BEzPaR6ry9XY_WDdA/edit#heading=h.qh7wl45v71jq)

<!-- more -->

## 使用场景

在使用代理上网的情况下,一般需要在每个应用中分别设置代理(如果应用支持代理),很难做到让所有网络流量默认都走代理。
Expand Down
18 changes: 12 additions & 6 deletions docs/blog/2015/redsocks.md → docs/blog/posts/redsocks2.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 10min
publish_date: 2015-11-19 21:25
authors:
- ginuerzh
categories:
- General
readtime: 10
date: 2015-11-19
comments: true
---

# linux下利用redsocks+iptables实现全局socks5代理上网

原文地址:[https://groups.google.com/g/go-gost/c/c7QCorgZiLU](https://groups.google.com/g/go-gost/c/c7QCorgZiLU)

之前写过一个[类似的文档](../2015/redirect.md),不过因为参杂了vpn配置,所以略微复杂,下面是简化版。
之前写过一个[类似的文档](redsocks.md),不过因为参杂了vpn配置,所以略微复杂,下面是简化版。

在linux下的应用若要使用socks5代理,一般都需要在应用内手动设置,而且有些应用不支持设置代理功能。
其实可以通过redsocks+iptables来实现类似于vpn功能,将所有tcp流量重定向到socks5代理(也支持https代理)。

<!-- more -->

步骤如下:

1. 安装redsocks:
Expand Down
15 changes: 10 additions & 5 deletions docs/blog/2023/relay-tunnel.md → docs/blog/posts/relay-tunnel.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 15min
publish_date: 2023-02-12 23:00
authors:
- ginuerzh
categories:
- Reverse Proxy
readtime: 15
date: 2023-02-12
comments: true
---

# 反向代理隧道实战

上一篇[博文](https://gost.run/blog/2023/reverse-proxy/)中,对反向代理和内网穿透做了基本的介绍。本篇将通过具体应用案例更加直观的展示[反向代理隧道](https://gost.run/tutorials/reverse-proxy-tunnel/)的使用。

反向代理隧道是将反向代理和内网穿透两个功能相结合一种技术手段,这两个概念之间其实没有必然的联系,反向代理可以不使用内网穿透,内网穿透也并不一定是为了实现反向代理,只不过很多情况下我们需要这两个功能组合在一起使用。例如一般的家庭网络或公司网络可能没有公网IP,因此无法通过公网直接访问,这个时候就需要用到内网穿透,通过一台具有公网IP的机器来间接的访问内网的服务。

<!-- more -->

假设有一台公网服务器并且绑定了域名my.domain。我们想要通过域名router.my.domain来访问到家庭网络中的路由器(192.168.1.1:80),并想要通过域名work.my.domain来访问公司中的项目管理平台(172.10.1.1:80)。

## 服务端
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
---
template: blog.html
author: ginuerzh
author_gh_user: ginuerzh
read_time: 30min
publish_date: 2023-01-16 22:00
authors:
- ginuerzh
categories:
- Reverse Proxy
readtime: 30
date: 2023-01-16
comments: true
---

# 反向代理与内网穿透

反向代理也是代理服务的一种,我们通常使用的代理服务,例如HTTP/SOCKS5代理,其代理的目标是客户端,代理服务代替客户端与所访问的服务器建立连接,而反向代理服务代理的目标是服务器,因此像HTTP/SOCKS5这种代理服务也被称作正向代理。二者的主要却别在于正向代理中客户端是知道代理服务的存在,而反向代理中客户端(甚至是服务端)是不知道代理服务的存在,在客户端看来代理服务就是我真正要访问的服务。

从某种角度来看,反向代理与端口转发是一样的,二者都是在两个端口之间建立映射关系,将数据从一个端口转发到另外一个端口,只不过反向代理会利用转发的数据进行更精确的控制,而端口转发一般不会依赖于数据的内容,仅仅是纯粹的端到端的转发行为。GOST中的反向代理就是基于端口转发来实现的。

<!-- more -->

GOST从v2.1版本开始就已经实现了[端口转发](https://v2.gost.run/port-forwarding/)的功能,其间这个功能一直没有多大的变化,直到v3.0.0-rc.1版本,为了实现[反向代理](https://gost.run/tutorials/reverse-proxy/)的功能而对端口转发进行了扩展。

## 反向代理
Expand Down
Loading

0 comments on commit 2e8f588

Please sign in to comment.