Skip to content
Snippets Groups Projects
Commit 589560b6 authored by Pratik Lagaskar's avatar Pratik Lagaskar
Browse files

add some instructions

parent 83b246b4
Branches
No related tags found
1 merge request!1Develop-blocker-library
WIP
# Vpn-Hole
# **VPN-Hole**
A self-contained GoLang library that is capable of blocking ads,malwares and trackers using [DNS Sinkholing](https://en.wikipedia.org/wiki/DNS_sinkhole). This libray can be integrated with different pre-existing cross-platform applications.
......@@ -10,7 +10,7 @@ You can learn more about the project from the [blogs](https://leap.se/#blog) at
* [Installation](#installation)
* [Go](#Go)
* [GoMobile](#GoMobile)
* [GoMobile & Gobind](#GoMobile & Gobind)
* [VPN-Hole](#VPN-Hole)
* [Instructions](#Instructions)
* [Build & Run](#Build & Run)
......@@ -22,43 +22,75 @@ You can learn more about the project from the [blogs](https://leap.se/#blog) at
## Installation <a name="installation"></a>
### Go <a name="Go"></a>
The detailed download and installation guide can be found at official website of [**Go**](https://go.dev/doc/install).
For Linux:
```
# 1. Download Go Binary Archive
wget https://golang.org/dl/go1.18.4.linux-amd64.tar.gz
```
# 2. Extract it
tar -xzf go1.18.4.linux-amd64.tar.gz -C /usr/local/
### GoMobile <a name="GoMobile"></a>
# 3. Add PATH Variables
sudo nano /etc/profile
export PATH=$PATH:/usr/local/go/bin
source /etc/profile
# 4. Check Go Version
go version
```
You can refer to the official documentation for setting **GOPATH**.
### GoMobile & Gobind <a name="GoMobile & Gobind"></a>
After installing Go, we need gobind. **Gobind** is a tool that generates language bindings that make it possible to call Go functions from Java and Objective-C. It is called internally by **gomobile** which can help us build cross-platform applications.
```
go install golang.org/x/mobile/cmd/gomobile@latest
## VPN-Hole <a name="VPN-Hole"></a>
# To compile Android APK and IOS Apps
gomobile bind [-target android|ios|iossimulator|macos|maccatalyst] [-bootclasspath <path>] [-classpath <path>] [-o output] [build flags] [package]
```
## VPN-Hole <a name="VPN-Hole"></a>
To clone and build VPN-Hole Library:
```
git clone https://0xacab.org/leap/vpn-hole.git
cd vpn-hole
```
### Instructions <a name="Instructions"></a>
To load all of the packages in the main module:
```
# If go.mod and go.sum are present then,
# Run
go mod tidy
```
If go.mod and go.sum are missing from the cloned repository, then:
```
go mod init [module-path]
```
## Build & Run <a name="Build & Run"></a>
```
# build the library
go build
```
An executable binary file would be generated for the library.
```
# executing the binary
```
## Integration <a name="Integration"></a>
## Integration <a name="Integration"></a>
To integrate the VPN-Hole Library with existing cross-platform applications, we will be using gomobile to compile and bind it.
```
```
### Adapting to Bitmask_core <a name="Adapting to Bitmask_core"></a>
```
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment