chore: rename go mod path
rabbitprincess committed
Apr 6, 2026 at 21:25 UTC
3744bf2e7b38427cf5a8976349cd4242b5832287
64 files changed
+175
-177
.github/workflows/cd.yml
+1
-1
@@ -7,7 +7,7 @@ on:
7
8
env:
9
REGISTRY: ghcr.io
10
- IMAGE_NAME: gosuda/portal
10
+ IMAGE_NAME: gosuda/portal-tunnel
11
PLATFORMS: linux/amd64,linux/arm64
12
13
concurrency:
README.md
+5
-5
@@ -36,13 +36,13 @@
36
### Expose your local app:
37
38
```bash
39
-curl -fsSL https://github.com/gosuda/portal/releases/latest/download/install.sh | bash
39
+curl -fsSL https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh | bash
40
portal expose 3000
41
```
42
43
```powershell
44
$ProgressPreference = 'SilentlyContinue'
45
-irm https://github.com/gosuda/portal/releases/latest/download/install.ps1 | iex
45
+irm https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1 | iex
46
portal expose 3000
47
```
48
@@ -52,8 +52,8 @@ For install details, see [cmd/portal-tunnel/README.md](cmd/portal-tunnel/README.
52
### Run your own relay
53
54
```bash
55
-git clone https://github.com/gosuda/portal
56
-cd portal && cp .env.example .env
55
+git clone https://github.com/gosuda/portal-tunnel
56
+cd portal-tunnel && cp .env.example .env
57
docker compose up
58
```
59
@@ -79,7 +79,7 @@ For architecture decisions, see [docs/adr/README.md](docs/adr/README.md).
79
80
Portal's official public relay registry is:
81
82
-`https://raw.githubusercontent.com/gosuda/portal/main/registry.json`
82
+`https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json`
83
84
Portal tunnel clients can include this registry by default, and the relay UI also reads from the same path to show the official relay list.
85
README.zh-CN.md
+5
-5
@@ -37,13 +37,13 @@
37
### 公开你的本地应用:
38
39
```bash
40
-curl -fsSL https://github.com/gosuda/portal/releases/latest/download/install.sh | bash
40
+curl -fsSL https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh | bash
41
portal expose 3000
42
```
43
44
```powershell
45
$ProgressPreference = 'SilentlyContinue'
46
-irm https://github.com/gosuda/portal/releases/latest/download/install.ps1 | iex
46
+irm https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1 | iex
47
portal expose 3000
48
```
49
@@ -53,8 +53,8 @@ portal expose 3000
53
### 运行你自己的中继
54
55
```bash
56
-git clone https://github.com/gosuda/portal
57
-cd portal && cp .env.example .env
56
+git clone https://github.com/gosuda/portal-tunnel
57
+cd portal-tunnel && cp .env.example .env
58
docker compose up
59
```
60
@@ -80,7 +80,7 @@ docker compose up
80
81
Portal 官方公共中继注册表为:
82
83
-`https://raw.githubusercontent.com/gosuda/portal/main/registry.json`
83
+`https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json`
84
85
Portal 隧道客户端可以默认包含这个注册表,Relay UI 也会从同一路径读取官方中继列表。
86
cmd/demo-app/handler.go
+1
-1
@@ -9,7 +9,7 @@ import (
9
10
"golang.org/x/net/websocket"
11
12
- "github.com/gosuda/portal/v2/sdk"
12
+ "github.com/gosuda/portal-tunnel/v2/sdk"
13
)
14
15
//go:embed static
cmd/demo-app/main.go
+3
-3
@@ -12,9 +12,9 @@ import (
12
"github.com/rs/zerolog"
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/sdk"
16
- "github.com/gosuda/portal/v2/types"
17
- "github.com/gosuda/portal/v2/utils"
15
+ "github.com/gosuda/portal-tunnel/v2/sdk"
16
+ "github.com/gosuda/portal-tunnel/v2/types"
17
+ "github.com/gosuda/portal-tunnel/v2/utils"
18
)
19
20
func main() {
cmd/portal-tunnel/README.md
+2
-2
@@ -7,14 +7,14 @@
7
Install directly from the official GitHub release assets:
8
9
```bash
10
-curl -fsSL https://github.com/gosuda/portal/releases/latest/download/install.sh | bash
10
+curl -fsSL https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh | bash
11
portal expose 3000
12
portal list
13
```
14
15
```powershell
16
$ProgressPreference = 'SilentlyContinue'
17
-irm https://github.com/gosuda/portal/releases/latest/download/install.ps1 | iex
17
+irm https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1 | iex
18
portal expose 3000
19
portal list
20
```
cmd/portal-tunnel/http_routes.go
+1
-1
@@ -12,7 +12,7 @@ import (
12
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/utils"
15
+ "github.com/gosuda/portal-tunnel/v2/utils"
16
)
17
18
type httpRoute struct {
cmd/portal-tunnel/installer/install.ps1
+1
-1
@@ -1,5 +1,5 @@
1
$ErrorActionPreference = "Stop"
2
-$BaseUrl = if ($env:BASE_URL) { $env:BASE_URL } else { "https://github.com/gosuda/portal/releases/latest/download" }
2
+$BaseUrl = if ($env:BASE_URL) { $env:BASE_URL } else { "https://github.com/gosuda/portal-tunnel/releases/latest/download" }
3
$RelayUrl = if ($env:RELAY_URL) { $env:RELAY_URL } else { "https://your-relay.example.com" }
4
$OriginalSecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol
5
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
cmd/portal-tunnel/installer/install.sh
+1
-1
@@ -21,7 +21,7 @@ case "$ARCH" in
21
;;
22
esac
23
24
-BASE_URL="${BASE_URL:-https://github.com/gosuda/portal/releases/latest/download}"
24
+BASE_URL="${BASE_URL:-https://github.com/gosuda/portal-tunnel/releases/latest/download}"
25
BIN_PATH_PREFIX="${BIN_PATH_PREFIX:-}"
26
BIN_SUFFIX="portal-$PORTAL_OS-$PORTAL_ARCH"
27
if [ -n "$BIN_PATH_PREFIX" ]; then
cmd/portal-tunnel/installer/installer.go
+1
-1
@@ -6,7 +6,7 @@ import (
6
"strings"
7
)
8
9
-const officialReleaseBaseURL = "https://github.com/gosuda/portal/releases/latest/download"
9
+const officialReleaseBaseURL = "https://github.com/gosuda/portal-tunnel/releases/latest/download"
10
11
//go:embed install.sh
12
var installShellScript string
cmd/portal-tunnel/main.go
+3
-3
@@ -12,9 +12,9 @@ import (
12
"github.com/rs/zerolog"
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/sdk"
16
- "github.com/gosuda/portal/v2/types"
17
- "github.com/gosuda/portal/v2/utils"
15
+ "github.com/gosuda/portal-tunnel/v2/sdk"
16
+ "github.com/gosuda/portal-tunnel/v2/types"
17
+ "github.com/gosuda/portal-tunnel/v2/utils"
18
)
19
20
func main() {
cmd/portal-tunnel/relays.go
+2
-2
@@ -12,8 +12,8 @@ import (
12
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/sdk"
16
- "github.com/gosuda/portal/v2/types"
15
+ "github.com/gosuda/portal-tunnel/v2/sdk"
16
+ "github.com/gosuda/portal-tunnel/v2/types"
17
)
18
19
func proxyExposure(ctx context.Context, exposure *sdk.Exposure) error {
cmd/relay-server/admin.go
+3
-3
@@ -11,9 +11,9 @@ import (
11
12
"github.com/rs/zerolog/log"
13
14
- "github.com/gosuda/portal/v2/portal/policy"
15
- "github.com/gosuda/portal/v2/types"
16
- "github.com/gosuda/portal/v2/utils"
14
+ "github.com/gosuda/portal-tunnel/v2/portal/policy"
15
+ "github.com/gosuda/portal-tunnel/v2/types"
16
+ "github.com/gosuda/portal-tunnel/v2/utils"
17
)
18
19
const (
cmd/relay-server/frontend.go
+4
-4
@@ -17,10 +17,10 @@ import (
17
"sync"
18
"sync/atomic"
19
20
- "github.com/gosuda/portal/v2/cmd/portal-tunnel/installer"
21
- "github.com/gosuda/portal/v2/portal"
22
- "github.com/gosuda/portal/v2/types"
23
- "github.com/gosuda/portal/v2/utils"
20
+ "github.com/gosuda/portal-tunnel/v2/cmd/portal-tunnel/installer"
21
+ "github.com/gosuda/portal-tunnel/v2/portal"
22
+ "github.com/gosuda/portal-tunnel/v2/types"
23
+ "github.com/gosuda/portal-tunnel/v2/utils"
24
)
25
26
type readDirFileFS interface {
cmd/relay-server/main.go
+4
-4
@@ -12,10 +12,10 @@ import (
12
"github.com/rs/zerolog"
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/portal"
16
- "github.com/gosuda/portal/v2/portal/acme"
17
- "github.com/gosuda/portal/v2/types"
18
- "github.com/gosuda/portal/v2/utils"
15
+ "github.com/gosuda/portal-tunnel/v2/portal"
16
+ "github.com/gosuda/portal-tunnel/v2/portal/acme"
17
+ "github.com/gosuda/portal-tunnel/v2/types"
18
+ "github.com/gosuda/portal-tunnel/v2/utils"
19
)
20
21
func main() {
docker-compose.yml
+1
-1
@@ -1,6 +1,6 @@
1
services:
2
portal:
3
- image: ghcr.io/gosuda/portal:latest
3
+ image: ghcr.io/gosuda/portal-tunnel:latest
4
build:
5
context: .
6
dockerfile: Dockerfile
docs/deployment.md
+1
-1
@@ -405,7 +405,7 @@ To persist this across reboots, add the values to `/etc/sysctl.conf` or a file i
405
406
## 6. Auto-Update
407
408
-Automatically redeploy when a new `ghcr.io/gosuda/portal:latest` image is pushed.
408
+Automatically redeploy when a new `ghcr.io/gosuda/portal-tunnel:latest` image is pushed.
409
410
### 6.1 Deploy script
411
docs/examples/nginx-proxy-multi-service/docker-compose.yaml
+1
-1
@@ -57,7 +57,7 @@ services:
57
# If you enable UDP, expose SNI_PORT/udp and MIN_PORT-MAX_PORT/udp as well.
58
# If you enable raw TCP transport, expose MIN_PORT-MAX_PORT/tcp as well.
59
portal:
60
- image: ghcr.io/gosuda/portal:latest
60
+ image: ghcr.io/gosuda/portal-tunnel:latest
61
container_name: portal
62
ports:
63
- "${API_PORT:-4017}:${API_PORT:-4017}/tcp"
docs/examples/nginx-proxy/deploy_portal.sh
+1
-1
@@ -1,7 +1,7 @@
1
#!/bin/bash
2
set -e
3
4
-docker pull ghcr.io/gosuda/portal:latest
4
+docker pull ghcr.io/gosuda/portal-tunnel:latest
5
docker compose down portal
6
docker compose up -d portal
7
bash nginx_deploy.sh
docs/examples/nginx-proxy/docker-compose.yaml
+1
-1
@@ -50,7 +50,7 @@ services:
50
# If you enable UDP, expose SNI_PORT/udp and MIN_PORT-MAX_PORT/udp as well.
51
# If you enable raw TCP transport, expose MIN_PORT-MAX_PORT/tcp as well.
52
portal:
53
- image: ghcr.io/gosuda/portal:latest
53
+ image: ghcr.io/gosuda/portal-tunnel:latest
54
container_name: portal
55
ports:
56
- "${API_PORT:-4017}:${API_PORT:-4017}/tcp"
docs/examples/nginx-proxy/watch_and_deploy.sh
+1
-1
@@ -1,7 +1,7 @@
1
#!/usr/bin/env bash
2
set -euo pipefail
3
4
-IMAGE="ghcr.io/gosuda/portal:latest"
4
+IMAGE="ghcr.io/gosuda/portal-tunnel:latest"
5
DIGEST_FILE="${DIGEST_FILE:-.portal_image_digest}"
6
INTERVAL="${INTERVAL:-60}"
7
DEPLOY_SCRIPT="${DEPLOY_SCRIPT:-deploy_portal.sh}"
extensions/vscode/README.md
+7
-7
@@ -1,6 +1,6 @@
1
# Portal VSCode Extension
2
3
-Expose your local service to the internet via a [Portal](https://github.com/gosuda/portal) relay tunnel, directly from VSCode.
3
+Expose your local service to the internet via a [Portal](https://github.com/gosuda/portal-tunnel) relay tunnel, directly from VSCode.
4
5
## Features
6
@@ -9,19 +9,19 @@ Expose your local service to the internet via a [Portal](https://github.com/gosu
9
- `Portal: Stop Tunnel` stops the active tunnel terminal
10
- Persisted settings for relay URLs, default local host, and default service name
11
- Runs the latest Portal release installer script before starting the tunnel
12
-- When no relay URL is configured, the extension can use the public registry at `https://raw.githubusercontent.com/gosuda/portal/main/registry.json`
12
+- When no relay URL is configured, the extension can use the public registry at `https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json`
13
14
## Requirements
15
16
-- A running [Portal relay server](https://github.com/gosuda/portal) with an `https://` URL
16
+- A running [Portal relay server](https://github.com/gosuda/portal-tunnel) with an `https://` URL
17
- `curl` on macOS/Linux, PowerShell on Windows
18
-- GitHub release asset access for `https://github.com/gosuda/portal/releases/latest/download/install.sh` or `install.ps1`
18
+- GitHub release asset access for `https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh` or `install.ps1`
19
20
## Settings
21
22
| Setting | Default | Description |
23
|---|---|---|
24
-| `portal.relayUrls` | `[]` | Relay server URLs (`https://` only). If empty, the extension uses `https://raw.githubusercontent.com/gosuda/portal/main/registry.json`. |
24
+| `portal.relayUrls` | `[]` | Relay server URLs (`https://` only). If empty, the extension uses `https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json`. |
25
| `portal.defaultHost` | `"localhost:3000"` | Default local host:port shown by `Portal: Start Tunnel`. |
26
| `portal.defaultName` | `""` | Default tunnel service name suggestion. If empty, the extension omits `--name`. |
27
@@ -51,8 +51,8 @@ To stop, run `Portal: Stop Tunnel` or close the `Portal Tunnel` terminal.
51
## Development
52
53
```bash
54
-git clone https://github.com/gosuda/portal
55
-cd portal/extensions/vscode
54
+git clone https://github.com/gosuda/portal-tunnel
55
+cd portal-tunnel/extensions/vscode
56
corepack pnpm install --frozen-lockfile
57
```
58
extensions/vscode/package.json
+1
-1
@@ -39,7 +39,7 @@
39
"type": "array",
40
"items": { "type": "string" },
41
"default": [],
42
- "description": "Relay server URLs (https only, e.g. https://my-relay.example.com). Leave empty to use the public registry at https://raw.githubusercontent.com/gosuda/portal/main/registry.json."
42
+ "description": "Relay server URLs (https only, e.g. https://my-relay.example.com). Leave empty to use the public registry at https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json."
43
},
44
"portal.defaultHost": {
45
"type": "string",
extensions/vscode/src/command.ts
+2
-2
@@ -2,8 +2,8 @@ import * as os from "os";
2
3
export type ShellTarget = "unix" | "windows";
4
5
-export const defaultRelayRegistryURL = "https://raw.githubusercontent.com/gosuda/portal/main/registry.json";
6
-export const defaultTunnelDownloadBaseURL = "https://github.com/gosuda/portal/releases/latest/download";
5
+export const defaultRelayRegistryURL = "https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json";
6
+export const defaultTunnelDownloadBaseURL = "https://github.com/gosuda/portal-tunnel/releases/latest/download";
7
8
export interface TunnelCommandOptions {
9
host: string;
extensions/vscode/src/test/extension.test.ts
+5
-5
@@ -16,11 +16,11 @@ suite("Extension Test Suite", () => {
16
test("resolveTunnelInstallerURL maps supported platforms to release installers", () => {
17
assert.strictEqual(
18
resolveTunnelInstallerURL("darwin", "x64"),
19
- "https://github.com/gosuda/portal/releases/latest/download/install.sh"
19
+ "https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh"
20
);
21
assert.strictEqual(
22
resolveTunnelInstallerURL("win32", "arm64"),
23
- "https://github.com/gosuda/portal/releases/latest/download/install.ps1"
23
+ "https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1"
24
);
25
assert.strictEqual(resolveTunnelInstallerURL("linux", "ia32"), undefined);
26
assert.strictEqual(resolveTunnelInstallerURL("freebsd", "x64"), undefined);
@@ -32,7 +32,7 @@ suite("Extension Test Suite", () => {
32
name: "",
33
relayList: "https://relay.example.com",
34
thumbnail: "",
35
- tunnelInstallerURL: "https://github.com/gosuda/portal/releases/latest/download/install.sh",
35
+ tunnelInstallerURL: "https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh",
36
}, {
37
shellTarget: "unix",
38
platform: "linux",
@@ -52,7 +52,7 @@ suite("Extension Test Suite", () => {
52
name: "",
53
relayList: "",
54
thumbnail: "",
55
- tunnelInstallerURL: "https://github.com/gosuda/portal/releases/latest/download/install.sh",
55
+ tunnelInstallerURL: "https://github.com/gosuda/portal-tunnel/releases/latest/download/install.sh",
56
}, {
57
shellTarget: "unix",
58
platform: "linux",
@@ -71,7 +71,7 @@ suite("Extension Test Suite", () => {
71
name: "my-app",
72
relayList: "https://relay.example.com",
73
thumbnail: "https://example.com/thumb.png",
74
- tunnelInstallerURL: "https://github.com/gosuda/portal/releases/latest/download/install.ps1",
74
+ tunnelInstallerURL: "https://github.com/gosuda/portal-tunnel/releases/latest/download/install.ps1",
75
}, {
76
shellTarget: "windows",
77
platform: "win32",
frontend/README.md
+1
-1
@@ -190,4 +190,4 @@ Radix Select values cannot be empty strings. Use stable values such as `"all"` a
190
191
## License
192
193
-Part of `gosuda/portal`.
193
+Part of `gosuda/portal-tunnel`.
frontend/src/components/Header.tsx
+1
-1
@@ -16,7 +16,7 @@ interface HeaderProps {
16
showQuickStartLink?: boolean;
17
}
18
19
-const repoURL = "https://github.com/gosuda/portal";
19
+const repoURL = "https://github.com/gosuda/portal-tunnel";
20
21
export function Header({
22
title = "PORTAL",
frontend/src/components/ServerListView.tsx
+2
-2
@@ -40,8 +40,8 @@ interface OfficialRegistryDocument {
40
}
41
42
const OFFICIAL_REGISTRY_SOURCE_URL =
43
- "https://raw.githubusercontent.com/gosuda/portal/main/registry.json";
44
-const REPOSITORY_URL = "https://github.com/gosuda/portal";
43
+ "https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json";
44
+const REPOSITORY_URL = "https://github.com/gosuda/portal-tunnel";
45
46
async function loadOfficialRegistryRelay(
47
relayURL: string,
go.mod
+1
-1
@@ -1,4 +1,4 @@
1
-module github.com/gosuda/portal/v2
1
+module github.com/gosuda/portal-tunnel/v2
2
3
go 1.26.1
4
portal/acme/acme.go
+1
-1
@@ -22,7 +22,7 @@ import (
22
"github.com/go-acme/lego/v4/registration"
23
"github.com/rs/zerolog/log"
24
25
- "github.com/gosuda/portal/v2/utils"
25
+ "github.com/gosuda/portal-tunnel/v2/utils"
26
)
27
28
const (
portal/acme/cloudflare/provider.go
+2
-2
@@ -11,8 +11,8 @@ import (
11
"github.com/go-acme/lego/v4/challenge"
12
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
13
14
- "github.com/gosuda/portal/v2/types"
15
- "github.com/gosuda/portal/v2/utils"
14
+ "github.com/gosuda/portal-tunnel/v2/types"
15
+ "github.com/gosuda/portal-tunnel/v2/utils"
16
)
17
18
const (
portal/acme/gcloud/provider.go
+2
-2
@@ -17,8 +17,8 @@ import (
17
"google.golang.org/api/dns/v1"
18
"google.golang.org/api/option"
19
20
- "github.com/gosuda/portal/v2/types"
21
- "github.com/gosuda/portal/v2/utils"
20
+ "github.com/gosuda/portal-tunnel/v2/types"
21
+ "github.com/gosuda/portal-tunnel/v2/utils"
22
)
23
24
const (
portal/acme/local.go
+1
-1
@@ -13,7 +13,7 @@ import (
13
"path/filepath"
14
"time"
15
16
- "github.com/gosuda/portal/v2/utils"
16
+ "github.com/gosuda/portal-tunnel/v2/utils"
17
)
18
19
const localDevelopmentCertificateTTL = 3650 * 24 * time.Hour
portal/acme/provider.go
+4
-4
@@ -7,10 +7,10 @@ import (
7
8
"github.com/go-acme/lego/v4/challenge"
9
10
- "github.com/gosuda/portal/v2/portal/acme/cloudflare"
11
- "github.com/gosuda/portal/v2/portal/acme/gcloud"
12
- "github.com/gosuda/portal/v2/portal/acme/route53"
13
- "github.com/gosuda/portal/v2/types"
10
+ "github.com/gosuda/portal-tunnel/v2/portal/acme/cloudflare"
11
+ "github.com/gosuda/portal-tunnel/v2/portal/acme/gcloud"
12
+ "github.com/gosuda/portal-tunnel/v2/portal/acme/route53"
13
+ "github.com/gosuda/portal-tunnel/v2/types"
14
)
15
16
const (
portal/acme/route53/provider.go
+2
-2
@@ -16,8 +16,8 @@ import (
16
"github.com/go-acme/lego/v4/challenge"
17
"github.com/go-acme/lego/v4/providers/dns/route53"
18
19
- "github.com/gosuda/portal/v2/types"
20
- "github.com/gosuda/portal/v2/utils"
19
+ "github.com/gosuda/portal-tunnel/v2/types"
20
+ "github.com/gosuda/portal-tunnel/v2/utils"
21
)
22
23
const (
portal/api_server.go
+7
-7
@@ -16,13 +16,13 @@ import (
16
"github.com/quic-go/quic-go"
17
"github.com/rs/zerolog/log"
18
19
- "github.com/gosuda/portal/v2/portal/auth"
20
- "github.com/gosuda/portal/v2/portal/discovery"
21
- "github.com/gosuda/portal/v2/portal/keyless"
22
- "github.com/gosuda/portal/v2/portal/policy"
23
- "github.com/gosuda/portal/v2/portal/transport"
24
- "github.com/gosuda/portal/v2/types"
25
- "github.com/gosuda/portal/v2/utils"
19
+ "github.com/gosuda/portal-tunnel/v2/portal/auth"
20
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
21
+ "github.com/gosuda/portal-tunnel/v2/portal/keyless"
22
+ "github.com/gosuda/portal-tunnel/v2/portal/policy"
23
+ "github.com/gosuda/portal-tunnel/v2/portal/transport"
24
+ "github.com/gosuda/portal-tunnel/v2/types"
25
+ "github.com/gosuda/portal-tunnel/v2/utils"
26
)
27
28
type apiError struct {
portal/auth/auth.go
+2
-2
@@ -13,8 +13,8 @@ import (
13
"github.com/go-jose/go-jose/v4/jwt"
14
"github.com/spruceid/siwe-go"
15
16
- "github.com/gosuda/portal/v2/types"
17
- "github.com/gosuda/portal/v2/utils"
16
+ "github.com/gosuda/portal-tunnel/v2/types"
17
+ "github.com/gosuda/portal-tunnel/v2/utils"
18
)
19
20
const (
portal/discovery/discovery.go
+3
-3
@@ -11,9 +11,9 @@ import (
11
12
"github.com/rs/zerolog/log"
13
14
- "github.com/gosuda/portal/v2/portal/keyless"
15
- "github.com/gosuda/portal/v2/types"
16
- "github.com/gosuda/portal/v2/utils"
14
+ "github.com/gosuda/portal-tunnel/v2/portal/keyless"
15
+ "github.com/gosuda/portal-tunnel/v2/types"
16
+ "github.com/gosuda/portal-tunnel/v2/utils"
17
)
18
19
const defaultRequestTimeout = 15 * time.Second
portal/discovery/relayset.go
+2
-2
@@ -11,8 +11,8 @@ import (
11
12
"github.com/rs/zerolog/log"
13
14
- "github.com/gosuda/portal/v2/types"
15
- "github.com/gosuda/portal/v2/utils"
14
+ "github.com/gosuda/portal-tunnel/v2/types"
15
+ "github.com/gosuda/portal-tunnel/v2/utils"
16
)
17
18
type RelayLocalState struct {
portal/keyless/client.go
+1
-1
@@ -13,7 +13,7 @@ import (
13
14
keylesstls "github.com/gosuda/keyless_tls/keyless"
15
16
- "github.com/gosuda/portal/v2/utils"
16
+ "github.com/gosuda/portal-tunnel/v2/utils"
17
)
18
19
func BuildClientTLSConfig(relayURL string, domains []string) (*tls.Config, ioCloser, error) {
portal/keyless/tls.go
+1
-1
@@ -11,7 +11,7 @@ import (
11
12
keylesstls "github.com/gosuda/keyless_tls/keyless"
13
14
- "github.com/gosuda/portal/v2/utils"
14
+ "github.com/gosuda/portal-tunnel/v2/utils"
15
)
16
17
func RelayRootCAs(ctx context.Context, endpoint, serverName string, rootCAPEM []byte) (*x509.CertPool, error) {
portal/lease.go
+5
-5
@@ -8,11 +8,11 @@ import (
8
"sync"
9
"time"
10
11
- "github.com/gosuda/portal/v2/portal/auth"
12
- "github.com/gosuda/portal/v2/portal/policy"
13
- "github.com/gosuda/portal/v2/portal/transport"
14
- "github.com/gosuda/portal/v2/types"
15
- "github.com/gosuda/portal/v2/utils"
11
+ "github.com/gosuda/portal-tunnel/v2/portal/auth"
12
+ "github.com/gosuda/portal-tunnel/v2/portal/policy"
13
+ "github.com/gosuda/portal-tunnel/v2/portal/transport"
14
+ "github.com/gosuda/portal-tunnel/v2/types"
15
+ "github.com/gosuda/portal-tunnel/v2/utils"
16
)
17
18
const defaultRegisterChallengeTTL = 2 * time.Minute
portal/lease_test.go
+3
-3
@@ -7,9 +7,9 @@ import (
7
"testing"
8
"time"
9
10
- "github.com/gosuda/portal/v2/portal/policy"
11
- "github.com/gosuda/portal/v2/portal/transport"
12
- "github.com/gosuda/portal/v2/types"
10
+ "github.com/gosuda/portal-tunnel/v2/portal/policy"
11
+ "github.com/gosuda/portal-tunnel/v2/portal/transport"
12
+ "github.com/gosuda/portal-tunnel/v2/types"
13
)
14
15
func TestLeaseRegistryLifecycle(t *testing.T) {
portal/server.go
+7
-7
@@ -17,13 +17,13 @@ import (
17
"github.com/rs/zerolog/log"
18
"golang.org/x/sync/errgroup"
19
20
- "github.com/gosuda/portal/v2/portal/acme"
21
- "github.com/gosuda/portal/v2/portal/discovery"
22
- "github.com/gosuda/portal/v2/portal/keyless"
23
- "github.com/gosuda/portal/v2/portal/policy"
24
- "github.com/gosuda/portal/v2/portal/transport"
25
- "github.com/gosuda/portal/v2/types"
26
- "github.com/gosuda/portal/v2/utils"
20
+ "github.com/gosuda/portal-tunnel/v2/portal/acme"
21
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
22
+ "github.com/gosuda/portal-tunnel/v2/portal/keyless"
23
+ "github.com/gosuda/portal-tunnel/v2/portal/policy"
24
+ "github.com/gosuda/portal-tunnel/v2/portal/transport"
25
+ "github.com/gosuda/portal-tunnel/v2/types"
26
+ "github.com/gosuda/portal-tunnel/v2/utils"
27
)
28
29
const (
portal/server_test.go
+4
-4
@@ -22,10 +22,10 @@ import (
22
"testing"
23
"time"
24
25
- "github.com/gosuda/portal/v2/portal/acme"
26
- "github.com/gosuda/portal/v2/portal/discovery"
27
- "github.com/gosuda/portal/v2/types"
28
- "github.com/gosuda/portal/v2/utils"
25
+ "github.com/gosuda/portal-tunnel/v2/portal/acme"
26
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
27
+ "github.com/gosuda/portal-tunnel/v2/types"
28
+ "github.com/gosuda/portal-tunnel/v2/utils"
29
)
30
31
func mustRelayDescriptor(t *testing.T, relayURL string) types.RelayDescriptor {
portal/transport/datagram_client.go
+2
-2
@@ -8,8 +8,8 @@ import (
8
"github.com/quic-go/quic-go"
9
"github.com/rs/zerolog/log"
10
11
- "github.com/gosuda/portal/v2/types"
12
- "github.com/gosuda/portal/v2/utils"
11
+ "github.com/gosuda/portal-tunnel/v2/types"
12
+ "github.com/gosuda/portal-tunnel/v2/utils"
13
)
14
15
type ClientDatagramState struct {
portal/transport/datagram_relay.go
+1
-1
@@ -12,7 +12,7 @@ import (
12
"github.com/quic-go/quic-go"
13
"github.com/rs/zerolog/log"
14
15
- "github.com/gosuda/portal/v2/types"
15
+ "github.com/gosuda/portal-tunnel/v2/types"
16
)
17
18
const (
portal/transport/datagram_session.go
+1
-1
@@ -8,7 +8,7 @@ import (
8
9
"github.com/quic-go/quic-go"
10
11
- "github.com/gosuda/portal/v2/types"
11
+ "github.com/gosuda/portal-tunnel/v2/types"
12
)
13
14
var errNoConnection = errors.New("no quic connection registered")
portal/transport/stream_client.go
+1
-1
@@ -10,7 +10,7 @@ import (
10
"sync"
11
"time"
12
13
- "github.com/gosuda/portal/v2/types"
13
+ "github.com/gosuda/portal-tunnel/v2/types"
14
)
15
16
type ClientStream struct {
portal/transport/stream_relay.go
+1
-1
@@ -10,7 +10,7 @@ import (
10
11
"github.com/rs/zerolog/log"
12
13
- "github.com/gosuda/portal/v2/types"
13
+ "github.com/gosuda/portal-tunnel/v2/types"
14
)
15
16
const defaultSessionWriteLimit = 5 * time.Second
sdk/api_client.go
+3
-3
@@ -18,9 +18,9 @@ import (
18
19
"github.com/quic-go/quic-go"
20
21
- "github.com/gosuda/portal/v2/portal/keyless"
22
- "github.com/gosuda/portal/v2/types"
23
- "github.com/gosuda/portal/v2/utils"
21
+ "github.com/gosuda/portal-tunnel/v2/portal/keyless"
22
+ "github.com/gosuda/portal-tunnel/v2/types"
23
+ "github.com/gosuda/portal-tunnel/v2/utils"
24
)
25
26
const (
sdk/expose.go
+3
-3
@@ -13,9 +13,9 @@ import (
13
14
"github.com/rs/zerolog/log"
15
16
- "github.com/gosuda/portal/v2/portal/discovery"
17
- "github.com/gosuda/portal/v2/types"
18
- "github.com/gosuda/portal/v2/utils"
16
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
17
+ "github.com/gosuda/portal-tunnel/v2/types"
18
+ "github.com/gosuda/portal-tunnel/v2/utils"
19
)
20
21
// Exposure owns the lifecycle of one or more relay listeners and accepts
sdk/expose_test.go
+2
-2
@@ -5,8 +5,8 @@ import (
5
"testing"
6
"time"
7
8
- "github.com/gosuda/portal/v2/portal/discovery"
9
- "github.com/gosuda/portal/v2/types"
8
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
9
+ "github.com/gosuda/portal-tunnel/v2/types"
10
)
11
12
func mustRelayDescriptor(t *testing.T, relayName, relayURL string) types.RelayDescriptor {
sdk/http.go
+33
-35
@@ -126,48 +126,46 @@ func serveCompressedHTTP(handler http.Handler, w http.ResponseWriter, r *http.Re
126
}
127
128
format := ""
129
- if r != nil {
130
- parseQuality := func(params string) float64 {
131
- for param := range strings.SplitSeq(params, ";") {
132
- key, value, ok := strings.Cut(strings.TrimSpace(param), "=")
133
- if !ok || !strings.EqualFold(strings.TrimSpace(key), "q") {
134
- continue
135
- }
129
+ parseQuality := func(params string) float64 {
130
+ for param := range strings.SplitSeq(params, ";") {
131
+ key, value, ok := strings.Cut(strings.TrimSpace(param), "=")
132
+ if !ok || !strings.EqualFold(strings.TrimSpace(key), "q") {
133
+ continue
134
+ }
135
137
- q, err := strconv.ParseFloat(strings.TrimSpace(value), 64)
138
- if err != nil || q < 0 {
139
- return 0
140
- }
141
- if q > 1 {
142
- return 1
143
- }
144
- return q
136
+ q, err := strconv.ParseFloat(strings.TrimSpace(value), 64)
137
+ if err != nil || q < 0 {
138
+ return 0
139
}
146
- return 1
140
+ if q > 1 {
141
+ return 1
142
+ }
143
+ return q
144
}
145
+ return 1
146
+ }
147
149
- bestQ := 0.0
150
- for rawPart := range strings.SplitSeq(r.Header.Get("Accept-Encoding"), ",") {
151
- part := strings.TrimSpace(strings.ToLower(rawPart))
152
- if part == "" {
153
- continue
154
- }
148
+ bestQ := 0.0
149
+ for rawPart := range strings.SplitSeq(r.Header.Get("Accept-Encoding"), ",") {
150
+ part := strings.TrimSpace(strings.ToLower(rawPart))
151
+ if part == "" {
152
+ continue
153
+ }
154
156
- name, params, _ := strings.Cut(part, ";")
157
- candidate := strings.TrimSpace(name)
158
- if candidate != "br" && candidate != "gzip" {
159
- continue
160
- }
155
+ name, params, _ := strings.Cut(part, ";")
156
+ candidate := strings.TrimSpace(name)
157
+ if candidate != "br" && candidate != "gzip" {
158
+ continue
159
+ }
160
162
- q := parseQuality(params)
163
- if q <= 0 {
164
- continue
165
- }
161
+ q := parseQuality(params)
162
+ if q <= 0 {
163
+ continue
164
+ }
165
167
- if q > bestQ || (q == bestQ && candidate == "br") {
168
- format = candidate
169
- bestQ = q
170
- }
166
+ if q > bestQ || (q == bestQ && candidate == "br") {
167
+ format = candidate
168
+ bestQ = q
169
}
170
}
171
if format == "" || strings.TrimSpace(r.Header.Get("Range")) != "" {
sdk/listener.go
+5
-5
@@ -14,11 +14,11 @@ import (
14
"github.com/quic-go/quic-go"
15
"github.com/rs/zerolog/log"
16
17
- "github.com/gosuda/portal/v2/portal/discovery"
18
- "github.com/gosuda/portal/v2/portal/keyless"
19
- "github.com/gosuda/portal/v2/portal/transport"
20
- "github.com/gosuda/portal/v2/types"
21
- "github.com/gosuda/portal/v2/utils"
17
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
18
+ "github.com/gosuda/portal-tunnel/v2/portal/keyless"
19
+ "github.com/gosuda/portal-tunnel/v2/portal/transport"
20
+ "github.com/gosuda/portal-tunnel/v2/types"
21
+ "github.com/gosuda/portal-tunnel/v2/utils"
22
)
23
24
type ListenerConfig struct {
sdk/mitm.go
+2
-2
@@ -17,8 +17,8 @@ import (
17
18
"github.com/rs/zerolog/log"
19
20
- "github.com/gosuda/portal/v2/types"
21
- "github.com/gosuda/portal/v2/utils"
20
+ "github.com/gosuda/portal-tunnel/v2/types"
21
+ "github.com/gosuda/portal-tunnel/v2/utils"
22
)
23
24
const (
sdk/mitm_test.go
+2
-2
@@ -18,8 +18,8 @@ import (
18
"testing"
19
"time"
20
21
- "github.com/gosuda/portal/v2/portal/discovery"
22
- "github.com/gosuda/portal/v2/types"
21
+ "github.com/gosuda/portal-tunnel/v2/portal/discovery"
22
+ "github.com/gosuda/portal-tunnel/v2/types"
23
)
24
25
func TestMITMProbeConnMatchesExporter(t *testing.T) {
sdk/sdk_test.go
+2
-2
@@ -12,8 +12,8 @@ import (
12
13
"github.com/spruceid/siwe-go"
14
15
- "github.com/gosuda/portal/v2/types"
16
- "github.com/gosuda/portal/v2/utils"
15
+ "github.com/gosuda/portal-tunnel/v2/types"
16
+ "github.com/gosuda/portal-tunnel/v2/utils"
17
)
18
19
func TestExposeNoRelayInputs(t *testing.T) {
types/types.go
+2
-2
@@ -1,9 +1,9 @@
1
package types
2
3
const (
4
- ReleaseVersion = "v2.1.2"
4
+ ReleaseVersion = "v2.1.3"
5
ProtocolVersion = "5"
6
- PortalRelayRegistryURL = "https://raw.githubusercontent.com/gosuda/portal/main/registry.json"
6
+ PortalRelayRegistryURL = "https://raw.githubusercontent.com/gosuda/portal-tunnel/main/registry.json"
7
8
HeaderAccessToken = "X-Portal-Access-Token"
9
MarkerKeepalive = byte(0x00)
utils/api.go
+1
-1
@@ -10,7 +10,7 @@ import (
10
"net/url"
11
"strings"
12
13
- "github.com/gosuda/portal/v2/types"
13
+ "github.com/gosuda/portal-tunnel/v2/types"
14
)
15
16
type APIErrorResponse struct {
utils/api_test.go
+1
-1
@@ -9,7 +9,7 @@ import (
9
"strings"
10
"testing"
11
12
- "github.com/gosuda/portal/v2/types"
12
+ "github.com/gosuda/portal-tunnel/v2/types"
13
)
14
15
func TestWriteAPIDataAndDecodeEnvelope(t *testing.T) {
utils/crypto.go
+1
-1
@@ -11,7 +11,7 @@ import (
11
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
12
"golang.org/x/crypto/sha3"
13
14
- "github.com/gosuda/portal/v2/types"
14
+ "github.com/gosuda/portal-tunnel/v2/types"
15
)
16
17
func NormalizeEVMAddress(raw string) (string, error) {
utils/identity.go
+1
-1
@@ -9,7 +9,7 @@ import (
9
"os"
10
"strings"
11
12
- "github.com/gosuda/portal/v2/types"
12
+ "github.com/gosuda/portal-tunnel/v2/types"
13
)
14
15
func NormalizeIdentity(identity types.Identity) (types.Identity, error) {
utils/network.go
+1
-1
@@ -10,7 +10,7 @@ import (
10
"strings"
11
"time"
12
13
- "github.com/gosuda/portal/v2/types"
13
+ "github.com/gosuda/portal-tunnel/v2/types"
14
)
15
16
var (