a proxy for http & https ,write by java,no dependences for other tech

Overview

申明

本项目只是作者记录和分享Java网络编程学习心得,请勿用于非法用途,否则后果自负!

原理介绍博客:

https://blog.csdn.net/wang382758656/article/details/123098032

https://juejin.cn/post/7069218800226271239

介绍

纯Java实现的网络代理小工具,可以实现http网络协议隐藏,突破局域网拦截,上班就可以开心的摸鱼了...

当然 你也可以用来学习Socket通信,多线程编程,也可以用于简单的生产环境,实现正向代理,流量监控,上网行为监控等。

本项目原始基于idea,可导入idea直接运行。

如何使用

直接运行已经打包好的jar(快速使用)

已经打包好的jar在这里

1.设置系统代理

要想看到效果,需要把你操作系统代理设置到 你LocalConfig.json文件设置的host和port上

设置代理方法,以win10 为例(Mac 自己搜索一下,也很简单,移动设备要使用这个代理的话,需要和运行这个代理程序客户端的主机在同一个局域网络 ,并且把代理设置到这个主机的IP和配置端口上)

    1.右击桌面右下角的wifi符号:选择弹出菜单“打开网络和internet设置“

    2.接着在打开的“设置“窗口中,点击”代理“

    3.在右侧的代理设置面板开启"使用代理服务器"开关

    4.并且在地址一栏填写: 127.0.0.1,端口一栏填写,LocalConfig.json中配置的port值

如果是PC 或者Mac 上,上述步骤可以通过bat脚本完成 ,前提需要配置JRE环境变量,

当然你也可以把JRE拷贝出来做一个整体包,直接点击脚本直接运行

Win shell:open_proxy.bat,close_proxy.bat

Mac shell: open_proxy.sh,close_proxy.sh

2.运行Jar包

分别将配置文件和jar放在同一个目录

在服务器上,运行server: java -jar MyNatServer.jar(如果在一台电脑上既运行客户端又运行服务器端,仅仅相当于charles抓包效果)

在你的电脑上,运行client: java -jar MyNatClient.jar

到此,你可以打开浏览器访问"一些网站"试试看,

#源码运行

##客户端 运行本地代理端主方法

    com.proxy.local.starter.LocalStarter

以这个类为主类打包可执行jar,LocalConfig.json文件放在和这个jar同一个目录下 运行时直接 java -jar MyNatClient.jar 即可.

###客户端配置文件详解 LocalConfig.json 这个文件和jar包放在同一个目录下

    {
     "remoteServer": "xx.xx.xx.xx",
     "remotePort": "1667",
     "host": "127.0.0.1",
     "port": "1666"
    }

remoteServer:远程代理服务器的IP

remotePort:远程代理服务器的端口,必须和RemoteConfig.json 配置的端口一致

host:本地代理ip,永远为127.0.0.1(设置到系统代理的Ip)

port:本地代理端口,可以是任意本地没有使用的端口(设置到系统代理的端口)


##服务器端 运行在服务器的主类

    com.proxy.remote.starter.RemoteStarter

以这个类为主类打包可执行jar,RemoteConfig.json文件放在和这个jar同一个目录下 运行时直接 java -jar MyNatServer.jar 即可.

###服务器端的配置详解 { "host": "127.0.0.1", "port": 1666, "responseHttps": "true", "enc": "true" }

host:远程代理服务器IP,因为是本地所以就是127.0.0.1" 永远不变,实际上你配置了也不会有任何影响

port:服务器接受客户端端网络请求端口(服务器端配置文件唯一需要修改的)

responseHttps:是否需要响应Https,永远是true(只有当做中间件的时候为false)

enc:是否加密,解密,建议永远是true

欢迎fork star !!!

You might also like...

Excel utility for Java to read and write data in declarative way.

Excel utility for Java to read and write data in declarative way.

Data Excel Exporter A Java wrapper using Apache POI to read and write Excel file in declarative fashion. Installation ExcelUtil is using Apache POI ve

Oct 16, 2022

@FengG0d 's Client, but he leave, I am the new owner, but, I don't know how to write Java, I need your help.

@FengG0d 's Client, but he leave, I am the new owner, but, I don't know how to write Java, I need your help.

IKUN Client Help me I need help! The original Author was leave, but I don't know how to write a good client, I need Your help! to make a good IKun Cli

Sep 4, 2022

An Auction website. Users can Put up items for sale, bid on currently active auctions and write reviews for items that they have won in the auctions.

Auction-Project An Auction website. Users can Put up items for sale, bid on currently active auctions and write reviews for items that they have won i

Sep 7, 2021

Library that makes it possible to read, edit and write CSV files

Library that makes it possible to read, edit and write CSV files

AdaptiveTableLayout Welcome the new CSV Library AdaptiveTableLayout for Android by Cleveroad Pay your attention to our new library that makes it possi

Jan 6, 2023

A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way.

MixinExtras A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way. More information about

Jan 7, 2023

Write enterprise Bitcoin applications with Spring Boot.

Write enterprise Bitcoin applications with Spring Boot.

Write enterprise Bitcoin applications with Spring Boot. Starter projects with multiple Bitcoin related modules that you can include in your application Google Colab

Dec 11, 2022

Generate a dynamic PAC script that will route traffic to your Burp proxy only if it matches the scope defined in your Burp target.

Generate a dynamic PAC script that will route traffic to your Burp proxy only if it matches the scope defined in your Burp target.

Burp PAC Server This Burp Extension generates a dynamic Proxy Auto-Configuration (PAC) script that will route traffic to your Burp proxy only if it ma

Jun 13, 2022

LimboAuth - Minecraft Auth System for Velocity proxy built in virtual server (Limbo).

LimboAuth Auth System built in virtual server (Limbo). MC-Market SpigotMC.org Описание и обсуждение на русском языке (spigotmc.ru) Описание и обсужден

Jan 4, 2023

🚀 A Motd Virtualization with Minecraft Proxy.

ProxyVirtualMotd プレイヤー別に 仮想 Motd を表示するプラグインです For Minecraft Proxy (BungeeCord / Waterfall) Plugin Waterfall 1.18 v483 動作確認済み Features 実装済みの機能です (今後、新機

Sep 21, 2022
Owner
Sand
Sand
Winfoom is an HTTP(s) proxy server facade that allows applications to authenticate through the proxy without having to deal with the actual handshake.

winfoom Basic Proxy Facade for NTLM, Kerberos, SOCKS and Proxy Auto Config file proxies To help this project please give it a star ⭐ Overview Winfoom

Eugen Covaci 56 Dec 8, 2022
A Velocity proxy plugin for Minecraft server discovery in k8s. All discovered servers are automatically added to the Velocity proxy.

kryo-server-discovery This plugin connects minecraft servers to a velocity proxy within Kubernetes. The service account in the namespace which the pro

Kryonite 9 Sep 13, 2022
This project uses the artificial potential field method to realize the path planning of the robot, and completes the trajectory optimization through other settings. It can also be combined with laser SLAM, target recognition and other technologies for path planning.

FRCAutoDriver 项目说明 Project Instruction 本项目利用人工势场法,实现机器人的路径规划,并通过其他设置完成轨迹优化,还可以结合激光SLAM、目标识别等技术进行路径规划 This project uses the artificial potential field

ZhangzrJerry 2 Sep 9, 2022
The project is an example of using the http web client to promote synchronous and asynchronous https calls.

Web Client Consumer Java Sample The project is an example of using the http web client to promote synchronous and asynchronous https calls. Requiremen

null 2 Jan 12, 2022
Repository for FIRST Tech Challenge team 3916 Apex Robotics for the 2021-2022 game year (Freight Frenzy)

FTC Team 3916 - Apex Robotics This is our repo for the 2020-2021 game year - Ultimate Goal Installation Clone this repo. You can do this through the w

Aman Anas 6 Nov 4, 2021
Tech Elevator Bootcamp Exercises and Projects

TechElevatorExercises A folder for all my Tech Elevator endeavors as I learn full-stack development bootcamp-style.

Kai Indigo Wolf 1 Jul 24, 2022
Jarm is a small Tech Minecraft Mod I'm coding

jarm Jarm is a small Tech Minecraft Mod I'm coding. This is currently WIP and may get discontinued. Also, I'm not a professional coder. #Installation

null 2 May 8, 2022
Curated Collection of all Low level design Questions and implementation asked in major Tech companies , Get yourself prepared for the LLD round and ace the interview.

Low level Design / Machine Coding Question Collections What is Machine Coding Round ? Machine Coding Round has become very popular interview round in

Kumaran gowthaman 619 Dec 31, 2022
Modded Minecraft client for 1.7.10 tech server.

Tomrum – 1.7.10 ForgeMod for Nullspace Adds some useful features for mainly creative dev: Simple implementation of Protocol4 which lets you connect to

Nullspace 3 Mar 9, 2022
httpx - CLI to test HTTP/gRPC/RSocket/Kafka... services by HTTP DSL

httpx: CLI for run http file httpx is a CLI to execute requests from JetBrains Http File. Request types supported by httpx HTTP REST PUB/SUB - Apache

servicex-sh 105 Dec 15, 2022