https://github.com/chinmayagrawal775/forward_proxy
Forward Proxy Built using GO that you can use right in your system
https://github.com/chinmayagrawal775/forward_proxy
concurrency forward-proxy golang goroutines profiling thread-pool
Last synced: about 2 months ago
JSON representation
Forward Proxy Built using GO that you can use right in your system
- Host: GitHub
- URL: https://github.com/chinmayagrawal775/forward_proxy
- Owner: chinmayagrawal775
- Created: 2024-09-14T13:57:50.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-09-16T15:03:24.000Z (8 months ago)
- Last Synced: 2024-12-15T05:41:38.807Z (5 months ago)
- Topics: concurrency, forward-proxy, golang, goroutines, profiling, thread-pool
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Forward Proxy Built using GO

[](https://go.dev/)
[](https://github.com/ellerbrock/open-source-badges/)## About Project ๐
What is forward proxy?
>
> From chatGPT:
>
> A forward proxy is a type of server that acts as an intermediary between a client and the internet. When a client makes a request to access a website or online resource, the request is first sent to the forward proxy server. The proxy then forwards this request to the destination server, retrieves the response, and sends it back to the client.## Prerequisites โ๏ธ
- Go installed on your system. (Version `1.23.0`)## Local Setup Guide ๐ ๏ธ
### Clone the repository
```
git clone [email protected]:chinmayagrawal775/forward_proxy.git
```### Go to project folder
```
cd forward_proxy
```### Run Proxy server using below command
```
go run main.go
```Above command will run the proxy server at below URL:
> http://127.0.0.1:6969By default it also starts the profiling server. You can access it at:
> http://127.0.0.1:6060/debug/pprof### Test Proxy server ๐งช
Run the below commands in new terminal
```
curl --proxy 127.0.0.1:6969 example.comcurl --proxy 127.0.0.1:6969 facebook.com
```
With the first commnad you will see the html output in your terminal.And with the second command you will see `Access to the site blocked!!` as `facebook.com` is a blocked site in proxy server. You can tweak it by modifying the `config/restricted-hosts.txt` file.
## Build Project ๐๏ธ
You can use the Makefile to create executable binary with the following command:
```
make build
```Or you can also simply run the following command also:
```
go build
```Both of the above commands will create the executable binaries with the name `foraward_proxy`
## How to use it as actual proxy server ๐ ๐
Here i am giving the example of using your proxy server in [FireFox Browser](https://www.mozilla.org/en-US/firefox/). You can easily configure your firefox browser to use this forward proxy. Below are the steps to do that:- Open Firefox, go to settings.
- In the General tab, at the very bottom, you will find the `Network Setting` section. Click the `Settings...` button
- Or you can also serach for `proxy` in the search bar of firefox settings
- In the opened modal, click the `Manual proxy configuration`
- Now you will have access to input the proxy URL.
- In HTTP proxy section enter the URL: `127.0.0.1` PORT: `6969`
- do check the `Also use this proxy for HTTPS` checkbox, so that HTTPs URLs will also be proxied.
- Click on `OK`Hurray ๐ ๐, Now you have cofigured the forward proxy in your firefox browser. All your request will now go through this proxy server. To verify check out the proxy server logs in terminal. You will find various requests logging there.