我不确定 说出具体使用方法是否安全 介绍梯子软件会被删帖吗?
我的用途是监视 浏览器通信数据
还有蓝灯开放127.0.0.1:8787
用软件转发到192.168.1.101:8790
然后手机设置这个代理地址 就可以了
我的用途是监视 浏览器通信数据
还有蓝灯开放127.0.0.1:8787
用软件转发到192.168.1.101:8790
然后手机设置这个代理地址 就可以了
<code class="lang-c">static void Main(string[] args) { TcpListene = new TcpListener(IPAddress.Parse("192.168.1.101"), 8790);//手机用的IP和端口 IP是你的电脑网卡的IP 端口随意 TcpListene.Start();//开始监听 new Task(() => { while (true) { NewClient(TcpListene.AcceptTcpClient());//新客户端接入 } }).Start(); } void NewClient(TcpClient BrowseService)//新客户端接入 { TcpClient AgencyClient = new TcpClient();//链接到蓝灯代理服务器 AgencyClient.Connect(IPAddress.Parse("127.0.0.1"), 8787);//蓝灯默认开放8787端口 var BrowserStream = BrowseService.GetStream(); var AgencyStream = AgencyClient.GetStream(); new Task(() => { byte[] buffer = new byte[64]; int count = 0; while ((count = BrowserStream.Read(buffer, 0, buffer.Length)) != 0) { try { AgencyStream.Write(buffer, 0, count); }//浏览器来的数据发给蓝灯 catch (Exception) { break; } //Console.WriteLine(string.Format("Beowser -> Agency:{0}", Encoding.Default.GetString(buffer,0,count)));//监视通信数据 } BrowserStream.Close(); }).Start(); new Task(() => { byte[] buffer = new byte[64]; int count = 0; while ((count = AgencyStream.Read(buffer, 0, buffer.Length)) != 0) { try { BrowserStream.Write(buffer, 0, count); }//蓝灯来的的数据发给浏览器 catch (Exception) { break; } //Console.WriteLine(string.Format("Agency -> Beowser:{0}", Encoding.Default.GetString(buffer, 0, count)));//监视通信数据 } AgencyStream.Close(); }).Start(); }</code>
引用 smith:用了之后 chrome的速度明显慢了很多,不知道是C#效率低 还是C#的socket效率低,还是别的问题
ssh转发用在一些国外的主机上面效率很低,这种转发还是很有用的
引用 yaozhiyu:肿么改?没发现蓝灯的配置文件在哪
不用这么麻烦,LANTERN修改一下配置文件,可以在网卡地址上监听的,手机直接设代理就行了
<code class="lang-c">TcpListener TcpListene; private void Form1_Load(object sender, EventArgs e) { TcpListene = new TcpListener(IPAddress.Parse("192.168.1.101"), 8790); TcpListene.Start();//开始监听 new Task(() => { while (true) { NewClient(TcpListene.AcceptTcpClient()); } }).Start(); } long a = 0, b = 0, c = 0, d = 0, f = 0; void NewClient(TcpClient BrowseService)//新客户端接入 { TcpClient AgencyClient = new TcpClient();//链接到代理服务器 AgencyClient.Connect(IPAddress.Parse("127.0.0.1"), 8787); var BrowserStream = BrowseService.GetStream(); var AgencyStream = AgencyClient.GetStream(); a++; Task t1 = new Task(() => { using (AgencyClient) using (BrowseService) using (AgencyStream) using (BrowserStream) { byte[] buffer = new byte[128]; int count = 0; while (true) { try { if ((count = BrowserStream.Read(buffer, 0, buffer.Length)) == 0) break; AgencyStream.Write(buffer, 0, count); } catch (Exception) { d++; break; } //Console.WriteLine(string.Format("Beowser -> Agency:{0}", Encoding.Default.GetString(buffer,0,count))); } b++; } }); t1.Start(); Task t2 = new Task(() => { using (AgencyClient) using (BrowseService) using (AgencyStream) using (BrowserStream) { byte[] buffer = new byte[128]; int count = 0; while (true) { try { if ((count = AgencyStream.Read(buffer, 0, buffer.Length)) == 0) break; BrowserStream.Write(buffer, 0, count); } catch (Exception) { f++; break; } //Console.WriteLine(string.Format("Agency -> Beowser:{0}", Encoding.Default.GetString(buffer, 0, count))); } c++; } }); t2.Start(); } private void timer1_Tick(object sender, EventArgs e) { this.Invoke(new Action(()=>{ label1.Text = string.Format("全部创建socket:{0}个\r\n关闭了socket:{2}个\r\n现有socke:{1}个\r\nb={3}个\r\nc={4}\r\nd={5}\r\nf={6}", a, a - (b + c)/2, (b + c)/2, b, c, d, f); })); }</code>
引用 yaozhiyu:谢谢
C:\Users\你的用户名\AppData\Roaming\Lantern目录下有一个文件lantern-2.0.10.yaml(可能版本不一样名字有点区别),用写字板打开(记事本打开不换行),有一行
addr: 127.0.0.1:8...
引用 我说要有光:这是linux的命令吧
iptables -t nat -I PREROUTING -p tcp --dport 8080 -j DNAT --to 42.42.42.42:8787
iptables -t nat -I POSTROUTING -p tcp -...
时段 | 个数 |
---|---|
{{f.startingTime}}点 - {{f.endTime}}点 | {{f.fileCount}} |
200字以内,仅用于支线交流,主线讨论请采用回复功能。