Skip to content

Commit 9424b8f

Browse files
henrybarretogustavosbarreto
authored andcommitted
feat(gateway,ssh,agent)!: rename http proxy handler endpoint
1 parent 672b39b commit 9424b8f

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

gateway/nginx/conf.d/shellhub.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ server {
680680
location ~ ^/(?<path>.*) {
681681
{{ set_upstream "ssh" 8080 }}
682682

683-
rewrite ^/(.*)$ /ssh/http break;
683+
rewrite ^/(.*)$ /http/proxy break;
684684
proxy_set_header X-Request-ID $request_id;
685685
proxy_set_header X-Address $address;
686686
proxy_set_header X-Path /$path$is_args$args;

pkg/agent/pkg/tunnel/tunnel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func NewTunnel() *Tunnel {
7676
e.GET("/ssh/close/:id", func(e echo.Context) error {
7777
return t.SSHCloseHandler(e)
7878
})
79-
e.CONNECT("/ssh/proxy/:addr", func(e echo.Context) error {
79+
e.CONNECT("/http/proxy/:addr", func(e echo.Context) error {
8080
// NOTE: The CONNECT HTTP method requests that a proxy establish a HTTP tunnel to this server, and if
8181
// successful, blindly forward data in both directions until the tunnel is closed.
8282
//

ssh/pkg/tunnel/tunnel.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ func NewTunnel(connection, dial, redisURI string) (*Tunnel, error) {
159159
return c.NoContent(http.StatusOK)
160160
})
161161

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

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

0 commit comments

Comments
 (0)