Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not build, nginx 1.25.1 #20

Open
harryqt opened this issue Jun 20, 2023 · 3 comments
Open

Can not build, nginx 1.25.1 #20

harryqt opened this issue Jun 20, 2023 · 3 comments

Comments

@harryqt
Copy link

harryqt commented Jun 20, 2023

Screenshot 2023-06-20 at 6 10 32 AM
s -I src/http -I src/http/modules \
	-o objs/src/http/modules/ngx_http_upstream_zone_module.o \
	src/http/modules/ngx_http_upstream_zone_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g   -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I objs -I src/http -I src/http/modules \
	-o objs/addon/src/ngx_http_socks_module.o \
	../socks-nginx-module/src/ngx_http_socks_module.c
../socks-nginx-module/src/ngx_http_socks_module.c: In function ‘ngx_http_socks_create_request’:
../socks-nginx-module/src/ngx_http_socks_module.c:991:33: error: ‘ngx_http_request_t’ {aka ‘struct ngx_http_request_s’} has no member named ‘space_in_uri’; did you mean ‘plus_in_uri’?
  991 |         if (r->quoted_uri || r->space_in_uri || r->internal) {
      |                                 ^~~~~~~~~~~~
      |                                 plus_in_uri
../socks-nginx-module/src/ngx_http_socks_module.c: In function ‘ngx_http_socks_add_x_forwarded_for_variable’:
../socks-nginx-module/src/ngx_http_socks_module.c:2228:38: error: ‘r->headers_in.x_forwarded_for’ is a pointer; did you mean to use ‘->’?
 2228 |     n = r->headers_in.x_forwarded_for.nelts;
      |                                      ^
      |                                      ->
../socks-nginx-module/src/ngx_http_socks_module.c:2229:38: error: ‘r->headers_in.x_forwarded_for’ is a pointer; did you mean to use ‘->’?
 2229 |     h = r->headers_in.x_forwarded_for.elts;
      |                                      ^
      |                                      ->
../socks-nginx-module/src/ngx_http_socks_module.c: In function ‘ngx_http_socks_init_headers’:
../socks-nginx-module/src/ngx_http_socks_module.c:3260:26: error: cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t *)’ {aka ‘long unsigned int (*)(ngx_http_script_engine_t *)’} to ‘void (*)(ngx_http_script_engine_t *)’ [-Werror=cast-function-type]
 3260 |             copy->code = (ngx_http_script_code_pt)
      |                          ^
../socks-nginx-module/src/ngx_http_socks_module.c:3295:26: error: cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t *)’ {aka ‘long unsigned int (*)(ngx_http_script_engine_t *)’} to ‘void (*)(ngx_http_script_engine_t *)’ [-Werror=cast-function-type]
 3295 |             copy->code = (ngx_http_script_code_pt)
      |                          ^
../socks-nginx-module/src/ngx_http_socks_module.c:3336:26: error: cast between incompatible function types from ‘size_t (*)(ngx_http_script_engine_t *)’ {aka ‘long unsigned int (*)(ngx_http_script_engine_t *)’} to ‘void (*)(ngx_http_script_engine_t *)’ [-Werror=cast-function-type]
 3336 |             copy->code = (ngx_http_script_code_pt)
      |                          ^
cc1: all warnings being treated as errors
make[1]: *** [objs/Makefile:1218: objs/addon/src/ngx_http_socks_module.o] Error 1
make[1]: Leaving directory '/home/harry/tmp/nginx-1.25.1'
make: *** [Makefile:10: build] Error 2
harry@host2:~/tmp/nginx-1.25.1$
@SkowRon96
Copy link

Nginx version 1.27.1 - still the same problem.

Is there any planned solution for this bug?
Or another option that will allow forwarding from http to socks5 in nginx?

@harryqt
Copy link
Author

harryqt commented Nov 29, 2024

Or another option that will allow forwarding from http to socks5 in nginx?

@SkowRon96 You can use proxy tunnel tools such as Gost. Following will create HTTP proxy and forward all request to socks5.

gost -L http://127.0.0.1:8081 -F socks5://127.0.0.1:9050

On nginx then you could do:

proxy_pass "http://127.0.0.1:8081";

@dannote
Copy link
Owner

dannote commented Nov 29, 2024

@SkowRon96 there was a lot of changes in nginx core since this module last release. I've started a complete rewrite but it's not ready yet. Maybe I'll finish it next year. Unfortunately I don't have enough free time now and I'm not willing to release something half-baked.

Also @harryqt is correct on that you can proxy your requests via something else. You could use, for instance, a transparent proxy like I did in abiko/tor2web.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants