Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 1af462c

Browse files
committed
Sock5 Server Code
🐛
1 parent b73b244 commit 1af462c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+52498
-2
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ dkms.conf
5454
# Project Related
5555
Socks5Agent/cmake-build-debug
5656
Socks5Agent/cmake-build-release
57+
Sock5Server/cmake-build-debug
58+
Sock5Server/cmake-build-release
59+
Build
60+
cmake

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22

33
A tiny Reverse Sock5 Proxy
44

5+
6+
### Server
7+
8+
The Server GUI Built with ImGui :V
9+
10+
<img src="https://i.imgur.com/VMs92ep.png">
11+
12+
U can download a prebuilt from [Releases](https://github.com/Coldzer0/ReverseSock5Proxy/releases).
13+
<br>
14+
15+
### Client/Agent
16+
17+
<b>Build it Yourself :P</b>
18+
519
### TODO
6-
- [ ] Finish the Server code
7-
- Already done but need some refactoring :P
820
- [ ] Refactor the code to support multi OS
921
- [X] I don't know
1022

1123
### Resources
1224

1325
- https://www.rfc-editor.org/rfc/rfc1928
26+
- [ImGui](https://github.com/ocornut/imgui)
27+
- [nlohmann JSON](https://github.com/nlohmann/json)
28+
- [mINI](https://github.com/pulzed/mINI)
1429

1530
<hr>
1631

Sock5Server/.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/.idea/Sock5Server.iml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/.idea/vcs.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sock5Server/CMakeLists.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
cmake_minimum_required(VERSION 3.22)
2+
3+
project ("SOCK5Server" CXX)
4+
5+
set(CMAKE_CXX_STANDARD 20)
6+
7+
# MSVC Static linking.
8+
if(MSVC)
9+
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
10+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
11+
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug")
12+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
13+
endif()
14+
endif()
15+
16+
# set the path to our cmake modules & generated cmake files from Conan.
17+
set(CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake")
18+
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
19+
20+
# CONFIG option is important so that CMake doesnt search for modules into the default modules directory
21+
find_package(imgui CONFIG)
22+
find_package(glfw3 CONFIG)
23+
find_package(glew CONFIG)
24+
25+
include_directories( "src" "src/UI" "src/UI/include" "src/bindings/imgui_backend" "src/bindings/stb" "src/bindings/mINI/src/mini")
26+
27+
# Locate all needed source & header files.
28+
file(GLOB source_files CONFIGURE_DEPENDS
29+
"src/UI/*.cpp"
30+
"src/UI/*.h"
31+
"src/UI/Font/*.h"
32+
"src/UI/src/*.cpp"
33+
"src/UI/include/*.h"
34+
"src/UI/src/Sock5/*.cpp"
35+
"src/UI/include/Sock5/*.h"
36+
"src/bindings/imgui_backend/*.cpp"
37+
"src/bindings/imgui_backend/*.h"
38+
)
39+
# Add source to this project's executable.
40+
add_executable (SOCK5Server WIN32
41+
"src/SOCK5Server.cpp"
42+
"src/SOCK5Server.h"
43+
${source_files}
44+
"src/bindings/mINI/src/mini/ini.h"
45+
"${CMAKE_CURRENT_SOURCE_DIR}/info.rc")
46+
47+
target_sources(SOCK5Server PRIVATE dpi-aware.manifest)
48+
49+
# Linker Options
50+
target_compile_definitions(SOCK5Server PUBLIC IMGUI_IMPL_OPENGL_LOADER_GLEW)
51+
target_link_libraries(SOCK5Server imgui::imgui GLEW::glew_s glfw::glfw ws2_32)
52+
53+
# Static linking libgcc, libstdc++ and winpthread.
54+
if(NOT MSVC)
55+
if (${CMAKE_BUILD_TYPE} MATCHES "Release")
56+
# -fuse-ld=lld
57+
target_link_options(SOCK5Server PRIVATE -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic -pthread -O3)
58+
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug")
59+
target_link_options(SOCK5Server PRIVATE -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic -pthread -O0)
60+
endif()
61+
endif()
62+
63+
if (CMAKE_VERSION VERSION_GREATER 3.12)
64+
set_property(TARGET SOCK5Server PROPERTY CXX_STANDARD 20)
65+
endif()

Sock5Server/CMakePresets.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": 3,
3+
"configurePresets": [
4+
{
5+
"name": "windows-base",
6+
"hidden": true,
7+
"generator": "Ninja",
8+
"binaryDir": "${sourceDir}/build/${presetName}",
9+
"installDir": "${sourceDir}/install/${presetName}",
10+
"cacheVariables": {
11+
"CMAKE_C_COMPILER": "cl.exe",
12+
"CMAKE_CXX_COMPILER": "cl.exe"
13+
},
14+
"condition": {
15+
"type": "equals",
16+
"lhs": "${hostSystemName}",
17+
"rhs": "Windows"
18+
}
19+
},
20+
{
21+
"name": "x64-debug",
22+
"displayName": "x64 Debug",
23+
"inherits": "windows-base",
24+
"architecture": {
25+
"value": "x64",
26+
"strategy": "external"
27+
},
28+
"cacheVariables": {
29+
"CMAKE_BUILD_TYPE": "Debug"
30+
}
31+
},
32+
{
33+
"name": "x86-debug",
34+
"displayName": "x86 Debug",
35+
"inherits": "windows-base",
36+
"architecture": {
37+
"value": "x86",
38+
"strategy": "external"
39+
},
40+
"cacheVariables": {
41+
"CMAKE_BUILD_TYPE": "Debug"
42+
}
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)