Spaces:
Paused
Paused
xukc
commited on
Commit
·
a97d8f8
1
Parent(s):
bb16f10
[fix]script
Browse files- .vscode/launch.json +1 -1
- Dockerfile +6 -6
- src/udp_client.cpp +2 -1
.vscode/launch.json
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
"type": "cppdbg",
|
7 |
"request": "launch",
|
8 |
"program": "${workspaceFolder}/proxyServer",
|
9 |
-
"args": ["1", "
|
10 |
"stopAtEntry": false,
|
11 |
"cwd": "${workspaceFolder}",
|
12 |
"environment": [],
|
|
|
6 |
"type": "cppdbg",
|
7 |
"request": "launch",
|
8 |
"program": "${workspaceFolder}/proxyServer",
|
9 |
+
"args": ["1", "8080"],
|
10 |
"stopAtEntry": false,
|
11 |
"cwd": "${workspaceFolder}",
|
12 |
"environment": [],
|
Dockerfile
CHANGED
@@ -49,16 +49,16 @@ WORKDIR /app
|
|
49 |
# Copy the source code into the container
|
50 |
COPY . .
|
51 |
|
52 |
-
# Compile the C++ program
|
53 |
-
RUN g++ -std=c++14 -g -o proxyServer src/*.cpp -I include -lhv -lspdlog
|
54 |
-
|
55 |
-
RUN apt-get install -y tzdata
|
56 |
-
|
57 |
# 设置时区为 Asia/Shanghai
|
58 |
ENV TZ=Asia/Shanghai
|
59 |
|
60 |
RUN dpkg-reconfigure --frontend noninteractive tzdata
|
61 |
|
|
|
|
|
|
|
|
|
|
|
62 |
EXPOSE 8080
|
63 |
# Run my_program when the container launches
|
64 |
-
CMD ["./proxyServer
|
|
|
49 |
# Copy the source code into the container
|
50 |
COPY . .
|
51 |
|
|
|
|
|
|
|
|
|
|
|
52 |
# 设置时区为 Asia/Shanghai
|
53 |
ENV TZ=Asia/Shanghai
|
54 |
|
55 |
RUN dpkg-reconfigure --frontend noninteractive tzdata
|
56 |
|
57 |
+
# Compile the C++ program
|
58 |
+
RUN g++ -std=c++14 -g -o proxyServer src/*.cpp -I include -lhv -lspdlog
|
59 |
+
|
60 |
+
RUN apt-get install -y tzdata
|
61 |
+
|
62 |
EXPOSE 8080
|
63 |
# Run my_program when the container launches
|
64 |
+
CMD ["./proxyServer"]
|
src/udp_client.cpp
CHANGED
@@ -48,7 +48,8 @@ int UdpServerBoltProxy::sendData(struct sockaddr_in t_addr, struct sockaddr_in u
|
|
48 |
xor_::crypt((char *)data, data_len, getConfig().ept_key);
|
49 |
}
|
50 |
PACK_TUNNEL_DATA(boltdata, boltdata_len, BOLT_VERSION, BOLT_RESERVE, BOLT_PAYLOAD_TYPE_UDP, t_addr.sin_addr.s_addr, t_addr.sin_port, u_addr.sin_addr.s_addr, u_addr.sin_port, config.session_id, 0, 0, data, data_len)
|
51 |
-
hio_write(io, boltdata, boltdata_len);
|
|
|
52 |
}
|
53 |
|
54 |
void UdpServerBoltProxy::closeClient(struct sockaddr_in &t_addr, struct sockaddr_in &u_addr)
|
|
|
48 |
xor_::crypt((char *)data, data_len, getConfig().ept_key);
|
49 |
}
|
50 |
PACK_TUNNEL_DATA(boltdata, boltdata_len, BOLT_VERSION, BOLT_RESERVE, BOLT_PAYLOAD_TYPE_UDP, t_addr.sin_addr.s_addr, t_addr.sin_port, u_addr.sin_addr.s_addr, u_addr.sin_port, config.session_id, 0, 0, data, data_len)
|
51 |
+
return hio_write(io, boltdata, boltdata_len);
|
52 |
+
|
53 |
}
|
54 |
|
55 |
void UdpServerBoltProxy::closeClient(struct sockaddr_in &t_addr, struct sockaddr_in &u_addr)
|