Skip to content

Commit

Permalink
feat(gateway,ssh,agent)!: rename http proxy handler endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybarreto authored and gustavosbarreto committed Jan 27, 2025
1 parent 672b39b commit 9424b8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gateway/nginx/conf.d/shellhub.conf
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ server {
location ~ ^/(?<path>.*) {
{{ set_upstream "ssh" 8080 }}

rewrite ^/(.*)$ /ssh/http break;
rewrite ^/(.*)$ /http/proxy break;
proxy_set_header X-Request-ID $request_id;
proxy_set_header X-Address $address;
proxy_set_header X-Path /$path$is_args$args;
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/pkg/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func NewTunnel() *Tunnel {
e.GET("/ssh/close/:id", func(e echo.Context) error {
return t.SSHCloseHandler(e)
})
e.CONNECT("/ssh/proxy/:addr", func(e echo.Context) error {
e.CONNECT("/http/proxy/:addr", func(e echo.Context) error {
// NOTE: The CONNECT HTTP method requests that a proxy establish a HTTP tunnel to this server, and if
// successful, blindly forward data in both directions until the tunnel is closed.
//
Expand Down
3 changes: 1 addition & 2 deletions ssh/pkg/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ func NewTunnel(connection, dial, redisURI string) (*Tunnel, error) {
return c.NoContent(http.StatusOK)
})

// TODO: Change this path.
tunnel.router.Any("/ssh/http", func(c echo.Context) error {
tunnel.router.Any("/http/proxy", func(c echo.Context) error {
requestID := c.Request().Header.Get("X-Request-ID")

address := c.Request().Header.Get("X-Address")
Expand Down

0 comments on commit 9424b8f

Please sign in to comment.