-
Notifications
You must be signed in to change notification settings - Fork 18
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
nc -X 5 -x 127.0.0.1:10022 host port
equivalent implementation by bridge.
#25
Comments
Yep export GIT_SSH_COMMAND='ssh -o ProxyCommand="bridge -p %h:%p -p socks5://127.0.0.1:10022"' |
I mean to work with git protocol like the following: $ GIT_PROXY_COMMAND=gitproxy.sh /usr/bin/git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
# or
$ /usr/bin/git -c 'core.gitProxy=gitproxy.sh' clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git And I have the following command currently in the executable script werner@x13dai-t:~$ which gitproxy.sh
/home/werner/.local/bin/gitproxy.sh
werner@x13dai-t:~$ grep -E '^[^#]' ` which gitproxy.sh `
exec nc -X 5 -x 127.0.0.1:10022 "$@" I have tried the following in the above script:
But the test failed:
I wonder how to use bridge to achieve the same purpose. BTW, the above error is exactly the same with the following command set in the above script:
As shown below:
But the following setting in the script works smoothly:
As shown below:
|
Back in the day, I researched git's 3 different proxy methods for 3 different protocols. I ended up keeping the http and ssh proxies. I can't remember why |
The git protocol doesn't seem to be very stable and robust. Here is the detailed debug information; I wonder if you can find any clues from it: werner@x13dai-t:~$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 GIT_TRACE_PERFORMANCE=1 GIT_TRACE_SETUP=1 /usr/bin/git -c 'core.gitProxy=gitproxy.sh' clone --verbose --progress git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
07:13:55.149579 git.c:455 trace: built-in: git clone --verbose --progress git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Cloning into 'linux'...
07:13:55.157708 run-command.c:668 trace: run_command: gitproxy.sh git.kernel.org 9418
2024/08/13 07:13:55 INFO DIAL "tcp://git.kernel.org:9418" <- "socks5://127.0.0.1:10022" <- LOCAL <- STDIO
chains="{Bind:[] Proxy:[{Probe: LB:[git.kernel.org:9418]} {Probe: LB:[socks5://127.0.0.1:10022]}] IdleTimeout:0s}"
07:13:57.402731 run-command.c:668 trace: run_command: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 10708 on x13dai-t' --check-self-contained-and-connected
2024/08/13 07:13:57 ERROR BridgeWithConfig chains="{Bind:[] Proxy:[{Probe: LB:[git.kernel.org:9418]} {Probe: LB:[socks5://127.0.0.1:10022]}] IdleTimeout:0s}" err="writeto tcp 127.0.0.1:37742->127.0.0.1:10022: read tcp 127.0.0.1:37742->127.0.0.1:10022: use of closed network connection"
fetch-pack: unexpected disconnect while reading sideband packet
07:13:57.420051 trace.c:387 setup: git_dir: /home/werner/linux/.git
07:13:57.420091 trace.c:388 setup: git_common_dir: /home/werner/linux/.git
07:13:57.420094 trace.c:389 setup: worktree: /home/werner
07:13:57.420096 trace.c:390 setup: cwd: /home/werner
07:13:57.420098 trace.c:391 setup: prefix: (null)
07:13:57.420100 git.c:455 trace: built-in: git index-pack --stdin -v --fix-thin '--keep=fetch-pack 10708 on x13dai-t' --check-self-contained-and-connected
fatal: early EOF
07:13:57.420618 trace.c:487 performance: 0.001764065 s: git command: /usr/lib/git-core/git index-pack --stdin -v --fix-thin '--keep=fetch-pack 10708 on x13dai-t' --check-self-contained-and-connected
fatal: fetch-pack: invalid index-pack output
07:13:57.423123 trace.c:487 performance: 2.273843841 s: git command: /usr/bin/git -c core.gitProxy=gitproxy.sh clone --verbose --progress git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git |
Can I use bridge to construct a git-protocol proxy which is equivalent to the following command?
nc -X 5 -x 127.0.0.1:10022 host port
Regards,
Zhao
The text was updated successfully, but these errors were encountered: