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

feat: ssh client implement #3671

Merged
merged 4 commits into from
Nov 14, 2023
Merged

Conversation

blizard863
Copy link
Collaborator

No description provided.

@blizard863 blizard863 force-pushed the feat_ssh_client branch 4 times, most recently from e443c8f to a5a9668 Compare November 8, 2023 12:50
@blizard863 blizard863 requested a review from fatedier November 8, 2023 13:22
@blizard863 blizard863 force-pushed the feat_ssh_client branch 2 times, most recently from 1018de7 to 0724b0f Compare November 8, 2023 13:31
go.mod Outdated Show resolved Hide resolved
client/control.go Outdated Show resolved Hide resolved
pkg/config/v1/server.go Outdated Show resolved Hide resolved
pkg/config/v1/server.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
server/service.go Outdated Show resolved Hide resolved
}
}

func parseSSHExtraMessage(s string) (p SSHExtraPayload, err error) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分需要看下怎么结合 cobra 来解析,能复用命令行参数解析的代码最好。

server/ssh_service.go Outdated Show resolved Hide resolved
server/ssh_service.go Outdated Show resolved Hide resolved
)

// VirtualService is a client VirtualService run in frps
type VirtualService struct {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的整体设计有问题,把部分 frps 的逻辑放到这里去运行了。

这里应该是一个 VirtualClient,构造一个虚拟的 net.Conn 和 frps 之间交互,然后负责处理和发送 Message。

@blizard863 blizard863 force-pushed the feat_ssh_client branch 2 times, most recently from b2aef87 to 4502159 Compare November 10, 2023 08:24
@@ -31,6 +41,9 @@ type ServerConfig struct {
// BindPort specifies the port that the server listens on. By default, this
// value is 7000.
BindPort int `json:"bindPort,omitempty"`

SSHTunnelGateway SSHTunnelGateway `json:"sshGatewayConfig,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SSHTunnelGateway SSHTunnelGateway `json:"sshGatewayConfig,omitempty"`
SSHTunnelGateway SSHTunnelGateway `json:"SSHTunnelGateway,omitempty"`

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不要放到 pkg/config 下面,应该放到 pkg/ssh 里

@fatedier fatedier merged commit 2085673 into fatedier:ssh-gateway Nov 14, 2023
1 check passed
@blizard863 blizard863 deleted the feat_ssh_client branch November 14, 2023 07:36
fatedier pushed a commit that referenced this pull request Nov 16, 2023
* feat: frps support ssh

* fix: comments

* fix: update pkg

* fix: remove useless change

---------

Co-authored-by: int7 <[email protected]>
fatedier pushed a commit that referenced this pull request Nov 22, 2023
* feat: frps support ssh

* fix: comments

* fix: update pkg

* fix: remove useless change

---------

Co-authored-by: int7 <[email protected]>
fatedier pushed a commit that referenced this pull request Nov 22, 2023
* feat: frps support ssh

* fix: comments

* fix: update pkg

* fix: remove useless change

---------

Co-authored-by: int7 <[email protected]>
github-actions bot added a commit to aiastia-dockerhub/frp that referenced this pull request Nov 22, 2023
* https://github.com/fatedier/frp:
  sshTunnelGateway refactor (fatedier#3784)
  feat: ssh client implement (fatedier#3671)
  Fix various typos (fatedier#3783)
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

Successfully merging this pull request may close these issues.

2 participants