Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
youngwolf
ascs
提交
0630eabe
A
ascs
项目概览
youngwolf
/
ascs
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ascs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0630eabe
编写于
9月 04, 2020
作者:
Y
youngwolf
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support up to 16 characters for the username and password of SOCKS5.
上级
79352dc7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
6 addition
and
6 deletion
+6
-6
examples/client/client.cpp
examples/client/client.cpp
+2
-2
include/ascs/tcp/proxy/socks.h
include/ascs/tcp/proxy/socks.h
+4
-4
未找到文件。
examples/client/client.cpp
浏览文件 @
0630eabe
...
...
@@ -75,7 +75,7 @@ public:
return
false
;
//without following setting, socks4::client_socket will be downgraded to normal client_socket
//socket_ptr->set_target_addr(
6000, "127.0.0.1
"); //target server address, original server address becomes SOCK4 server address
//socket_ptr->set_target_addr(
9527, "172.27.0.14
"); //target server address, original server address becomes SOCK4 server address
return
socket_ptr
->
send_msg
(
std
::
move
(
msg
));
}
...
...
@@ -126,7 +126,7 @@ int main(int argc, const char* argv[])
client
.
set_server_addr
(
port
,
ip
);
//without following setting, socks5::single_client will be downgraded to normal single_client
//client.set_target_addr(
6000, "127.0.0.1"); //target server address, original server address becomes SOCK4
server address
//client.set_target_addr(
9527, "172.27.0.14"); //target server address, original server address becomes SOCK5
server address
//client.set_auth("ascs", "ascs"); //can be omitted if the SOCKS5 server support non-auth
client2
.
set_server_addr
(
port
+
100
,
ip
);
...
...
include/ascs/tcp/proxy/socks.h
浏览文件 @
0630eabe
...
...
@@ -176,11 +176,11 @@ private:
res_len
=
0
;
req
[
0
]
=
1
;
req
[
1
]
=
(
char
)
std
::
min
(
username
.
size
(),
(
size_t
)
8
);
req
[
1
]
=
(
char
)
std
::
min
(
username
.
size
(),
(
size_t
)
16
);
memcpy
(
std
::
next
(
req
,
2
),
username
.
data
(),
(
size_t
)
req
[
1
]);
req
[
2
+
req
[
1
]]
=
(
char
)
std
::
min
(
password
.
size
(),
(
size_t
)
8
);
req
[
2
+
req
[
1
]]
=
(
char
)
std
::
min
(
password
.
size
(),
(
size_t
)
16
);
memcpy
(
std
::
next
(
req
,
3
+
req
[
1
]),
password
.
data
(),
(
size_t
)
req
[
2
+
req
[
1
]]);
req_len
=
2
+
req
[
1
]
+
1
+
req
[
2
+
req
[
1
]];
req_len
=
1
+
1
+
req
[
1
]
+
1
+
req
[
2
+
req
[
1
]];
asio
::
async_write
(
this
->
next_layer
(),
asio
::
buffer
(
req
,
req_len
),
this
->
make_handler_error_size
([
this
](
const
asio
::
error_code
&
ec
,
size_t
bytes_transferred
)
{
this
->
send_handler
(
ec
,
bytes_transferred
);}));
...
...
@@ -331,7 +331,7 @@ private:
}
private:
char
req
[
24
],
res
[
24
];
char
req
[
40
],
res
[
24
];
size_t
req_len
,
res_len
;
int
step
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录