Golang gRPC实现内网穿透

Python011

Golang gRPC实现内网穿透,第1张

内网穿透即是使用公网服务器作为代理,转发内网(如办公室、家里)的网络请求使其能够在外网中被访问到。

server端监听两个端口,一个用来和接收用户的http请求,一个监听gRPC客户端,和内网服务器进行通信;

client启动时连接server端;

当User请求server http端口时,将http进行阻塞,并将User请求内容通过gRPC发给client;

client将从server收到的请求发往本地的http服务;

client将从本地程序收到的http response通过gRPC发送给server;

server结束http阻塞,将从client收到的http response发给User。

github地址: https://github.com/itchin/proxy

through:指在内部穿过,例:穿过门,窗,森林,公园竺等

across:指在表面穿过,例:穿过街道,河流,桥梁等.

go

through

是指从事物内部穿过,如

go

throug

a

forest

go

across

是指从事物表面通过,如

go

across

the

road

go through the street/ road 正确,意思是:纵穿马路。区别于go across the street/ road ,横穿马路。

through英 [θruː]     美 [θruː]

adv.通过;径直;自始至终;(电话)接通;完全

prep.穿过;凭借;一直到

adj.直达的;直通的;贯穿的;完成的;结束的

用作副词 (adv.)

1、The crowd fell back to let the players through.

人群后退让运动员们通过。

2、Put the coffee in the filter and let the water through.

把咖啡放入过滤器里让水流过。

3、"Did you stop in Oxford on the way?""No, we drove straight through."

“你们路径牛津时停车了吗?”“没有,我们一直来过来的。”

用作介词 (prep.)

1、The ball went through the window.

那球穿过窗子飞去。

2、The journey through the jungle was perilous.

穿过丛林的旅行充满了危险。

3、The hunter stalked the bear through the woods.

那个猎人穿过树林,悄悄走近熊。

用作形容词 (adj.)

1、Welcome on board the 94 through train to Guangzhou.

欢迎乘坐开往广州去的94次直达列车。

2、We found a through street.

我们发现了一条走得通的路。