Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
9fa3f461
Unverified
Commit
9fa3f461
authored
Apr 12, 2022
by
septs
Committed by
GitHub
Apr 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(shell-proxy): make ssh-proxy compatible with macOS (#10640)
parent
846f417e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
.editorconfig
plugins/shell-proxy/.editorconfig
+3
-0
ssh-proxy.py
plugins/shell-proxy/ssh-proxy.py
+13
-10
No files found.
plugins/shell-proxy/.editorconfig
0 → 100644
View file @
9fa3f461
[*.py]
indent_size = 4
indent_style = space
plugins/shell-proxy/ssh-proxy.py
View file @
9fa3f461
...
...
@@ -20,14 +20,17 @@ proxy_protocols = {
if
parsed
.
scheme
not
in
proxy_protocols
:
raise
TypeError
(
'unsupported proxy protocol: "{}"'
.
format
(
parsed
.
scheme
))
argv
=
[
"nc"
,
"-X"
,
proxy_protocols
[
parsed
.
scheme
],
# Supported protocols are 4 (SOCKS v4), 5 (SOCKS v5) and connect (HTTP proxy). Default SOCKS v5 is used.
"-x"
,
parsed
.
netloc
,
# proxy-host:proxy-port
sys
.
argv
[
1
],
# host
sys
.
argv
[
2
],
# port
]
def
make_argv
():
yield
"nc"
if
sys
.
platform
==
'linux'
:
# caveats: macOS built-in netcat command not supported proxy-type
yield
"-X"
# --proxy-type
# Supported protocols are 4 (SOCKS v4), 5 (SOCKS v5) and connect (HTTP proxy).
# Default SOCKS v5 is used.
yield
proxy_protocols
[
parsed
.
scheme
]
yield
"-x"
# --proxy
yield
parsed
.
netloc
# proxy-host:proxy-port
yield
sys
.
argv
[
1
]
# host
yield
sys
.
argv
[
2
]
# port
subprocess
.
call
(
argv
)
subprocess
.
call
(
make_argv
()
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment