Skip to content

Commit f143d46

Browse files
committed
http server listening port change from 8199 to 8000
1 parent 308b937 commit f143d46

File tree

24 files changed

+51
-51
lines changed

24 files changed

+51
-51
lines changed

httpserver/jwt/README.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ jwt/
5555
go run main.go
5656
```
5757

58-
2. The server will start on port 8199
58+
2. The server will start on port 8000
5959

6060
## Testing the API
6161

6262
1. Login to get a token:
6363
```bash
64-
curl -X POST http://localhost:8199/login \
64+
curl -X POST http://localhost:8000/login \
6565
-H "Content-Type: application/json" \
6666
-d '{"username":"admin","password":"password"}'
6767
```
6868

6969
2. Access protected endpoint:
7070
```bash
71-
curl http://localhost:8199/api/protected \
71+
curl http://localhost:8000/api/protected \
7272
-H "Authorization: Bearer your-token-here"
7373
```
7474

httpserver/jwt/README.ZH.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ jwt/
5555
go run main.go
5656
```
5757

58-
2. 服务器将在`8199`端口启动
58+
2. 服务器将在`8000`端口启动
5959

6060
## 测试API
6161

6262
1. 登录获取令牌:
6363
```bash
64-
curl -X POST http://localhost:8199/login \
64+
curl -X POST http://localhost:8000/login \
6565
-H "Content-Type: application/json" \
6666
-d '{"username":"admin","password":"password"}'
6767
```
6868

6969
2. 访问受保护的接口:
7070
```bash
71-
curl http://localhost:8199/api/protected \
71+
curl http://localhost:8000/api/protected \
7272
-H "Authorization: Bearer your-token-here"
7373
```
7474

httpserver/jwt/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ func main() {
3434
})
3535
})
3636

37-
s.SetPort(8199)
37+
s.SetPort(8000)
3838
s.Run()
3939
}

httpserver/proxy/README.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ hide_title: true
1414
This example demonstrates how to create a reverse proxy server using `GoFrame`. The example consists of two servers:
1515

1616
1. A backend server running on port 8198 that provides the actual service
17-
2. A proxy server running on port 8199 that forwards requests to the backend server
17+
2. A proxy server running on port 8000 that forwards requests to the backend server
1818

1919
The proxy server implements the following features:
2020
- Reverse proxy functionality using `httputil.NewSingleHostReverseProxy`
@@ -69,10 +69,10 @@ The proxy server implements the following features:
6969

7070
2. The example will start two servers:
7171
- Backend server at: http://127.0.0.1:8198
72-
- Proxy server at: http://127.0.0.1:8199
72+
- Proxy server at: http://127.0.0.1:8000
7373

7474
3. Test the proxy:
75-
- Access through proxy: http://127.0.0.1:8199/proxy/user/1
75+
- Access through proxy: http://127.0.0.1:8000/proxy/user/1
7676
- Direct backend access: http://127.0.0.1:8198/user/1
7777

7878
## Implementation Details

httpserver/proxy/README.ZH.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sidebar_position: 1
1414
本示例展示了如何使用 `GoFrame` 创建一个反向代理服务器。示例包含两个服务器:
1515

1616
1.`8198` 端口运行的后端服务器,提供实际服务
17-
2.`8199` 端口运行的代理服务器,将请求转发到后端服务器
17+
2.`8000` 端口运行的代理服务器,将请求转发到后端服务器
1818

1919
代理服务器实现了以下功能:
2020
- 使用 `httputil.NewSingleHostReverseProxy` 实现反向代理功能
@@ -39,9 +39,9 @@ sidebar_position: 1
3939

4040
2. 服务监听两个端口:
4141
- 后端服务器在 http://127.0.0.1:8198
42-
- 代理服务器在 http://127.0.0.1:8199
42+
- 代理服务器在 http://127.0.0.1:8000
4343

4444
3. 测试代理:
45-
- 通过代理访问:http://127.0.0.1:8199/proxy/user/1
45+
- 通过代理访问:http://127.0.0.1:8000/proxy/user/1
4646
- 直接访问后端:http://127.0.0.1:8198/user/1
4747

httpserver/proxy/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
// PortOfServerBackend defines the port number for the backend server
2525
PortOfServerBackend = 8198
2626
// PortOfServerProxy defines the port number for the proxy server
27-
PortOfServerProxy = 8199
27+
PortOfServerProxy = 8000
2828
// UpStream defines the backend server URL that the proxy will forward requests to
2929
UpStream = "http://127.0.0.1:8198"
3030
)

httpserver/rate-limit/README.ZH.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ sidebar_position: 2
3636
2. 测试限流:
3737
```bash
3838
# 正常请求
39-
curl http://localhost:8199/hello?name=world
39+
curl http://localhost:8000/hello?name=world
4040

4141
# 快速发送多个请求测试限流
42-
for i in {1..20}; do curl http://localhost:8199/hello?name=world; done
42+
for i in {1..20}; do curl http://localhost:8000/hello?name=world; done
4343
```

httpserver/response-json-array/README.MD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ The example implements a `/user` endpoint that returns a list of users in JSON a
4646
go run main.go
4747
```
4848

49-
2. The server will start at http://127.0.0.1:8199
49+
2. The server will start at http://127.0.0.1:8000
5050

5151
3. Access the endpoints:
5252
```bash
5353
# Get user list
54-
curl "http://127.0.0.1:8199/user"
54+
curl "http://127.0.0.1:8000/user"
5555

5656
# View API documentation
57-
# Open in browser: http://127.0.0.1:8199/swagger
57+
# Open in browser: http://127.0.0.1:8000/swagger
5858
```
5959

6060
## Implementation Details

httpserver/response-json-array/README.ZH.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ sidebar_position: 99
3737
go run main.go
3838
```
3939

40-
2. 测试接口:http://localhost:8199/user
40+
2. 测试接口:http://localhost:8000/user
4141

42-
3. 接口文档:http://127.0.0.1:8199/swagger
42+
3. 接口文档:http://127.0.0.1:8000/swagger

httpserver/response-json-array/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ func main() {
7171
// Set up API documentation paths
7272
s.SetOpenApiPath("/api")
7373
s.SetSwaggerPath("/swagger")
74-
s.SetPort(8199)
74+
s.SetPort(8000)
7575
s.Run()
7676
}

httpserver/upload-file/README.MD

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ upload-file/
6161
go run main.go
6262
```
6363

64-
2. The server will start at http://127.0.0.1:8199
64+
2. The server will start at http://127.0.0.1:8000
6565

6666
3. Access the upload interface:
67-
- Web Interface: http://127.0.0.1:8199/
68-
- API Endpoint: POST http://127.0.0.1:8199/upload
67+
- Web Interface: http://127.0.0.1:8000/
68+
- API Endpoint: POST http://127.0.0.1:8000/upload
6969

7070
4. Upload files using either:
7171
- The web interface by selecting a file and clicking "Upload"
7272
- Using curl:
7373
```bash
74-
curl -X POST http://127.0.0.1:8199/upload \
74+
curl -X POST http://127.0.0.1:8000/upload \
7575
-F "file=@/path/to/your/file" \
7676
-F "msg=Optional message"
7777
```

httpserver/upload-file/README.ZH.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ sidebar_position: 3
4242
go run main.go
4343
```
4444

45-
2. 上传页面:http://localhost:8199/upload.html
45+
2. 上传页面:http://localhost:8000/upload.html
4646

4747

httpserver/upload-file/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func main() {
7070

7171
// Configure server settings
7272
s.SetClientMaxBodySize(600 * 1024 * 1024) // 600MB max file size
73-
s.SetPort(8199)
73+
s.SetPort(8000)
7474
s.SetAccessLogEnabled(true)
7575

7676
// Start the server

observability/trace/http-with-db/README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@ The example demonstrates:
187187
- Ensure trace endpoint is correct in configuration
188188

189189
4. HTTP Issues:
190-
- Check if server is running: `curl http://localhost:8199/ping`
190+
- Check if server is running: `curl http://localhost:8000/ping`
191191
- Verify request format matches API specification
192192
- Check server logs for detailed error messages

observability/trace/http-with-db/README.ZH.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ redis:
184184
defer span.End()
185185

186186
// 发送HTTP请求
187-
err = client.PostVar(ctx, "http://127.0.0.1:8199/user/insert", g.Map{
187+
err = client.PostVar(ctx, "http://127.0.0.1:8000/user/insert", g.Map{
188188
"name": "john",
189189
}).Scan(&insertRes)
190190
```

observability/trace/http-with-db/client/client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727

2828
// Service configuration constants
2929
const (
30-
serviceName = "otlp-http-client-with-db" // Name of the service for tracing
31-
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // Tracing endpoint
32-
path = "adapt_******_******/api/otlp/traces" // Tracing path
30+
serviceName = "otlp-http-client-with-db" // Name of the service for tracing
31+
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // Tracing endpoint
32+
path = "adapt_******_******/api/otlp/traces" // Tracing path
3333
)
3434

3535
// main initializes and starts an HTTP client with tracing
@@ -66,7 +66,7 @@ func StartRequests() {
6666
ghttp.DefaultHandlerResponse
6767
Data struct{ ID int64 } `json:"data"`
6868
}{}
69-
err = client.PostVar(ctx, "http://127.0.0.1:8199/user/insert", g.Map{
69+
err = client.PostVar(ctx, "http://127.0.0.1:8000/user/insert", g.Map{
7070
"name": "john",
7171
}).Scan(&insertRes)
7272
if err != nil {
@@ -84,7 +84,7 @@ func StartRequests() {
8484
ghttp.DefaultHandlerResponse
8585
Data struct{ User gdb.Record } `json:"data"`
8686
}{}
87-
err = client.GetVar(ctx, "http://127.0.0.1:8199/user/query", g.Map{
87+
err = client.GetVar(ctx, "http://127.0.0.1:8000/user/query", g.Map{
8888
"id": insertRes.Data.ID,
8989
}).Scan(&queryRes)
9090
if err != nil {
@@ -97,7 +97,7 @@ func StartRequests() {
9797
var deleteRes = struct {
9898
ghttp.DefaultHandlerResponse
9999
}{}
100-
err = client.PostVar(ctx, "http://127.0.0.1:8199/user/delete", g.Map{
100+
err = client.PostVar(ctx, "http://127.0.0.1:8000/user/delete", g.Map{
101101
"id": insertRes.Data.ID,
102102
}).Scan(&deleteRes)
103103
if err != nil {

observability/trace/http-with-db/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func main() {
6161
s.Group("/", func(group *ghttp.RouterGroup) {
6262
group.ALL("/user", new(cTrace))
6363
})
64-
s.SetPort(8199)
64+
s.SetPort(8000)
6565
s.Run()
6666
}
6767

observability/trace/http/README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ The example demonstrates:
104104
## Troubleshooting
105105

106106
1. Server Issues:
107-
- Ensure server is running: `curl http://localhost:8199/hello`
107+
- Ensure server is running: `curl http://localhost:8000/hello`
108108
- Check server logs for detailed error messages
109109

110110
2. Tracing Issues:

observability/trace/http/README.ZH.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@ sidebar_position: 1
115115
ctx = gtrace.SetBaggageValue(ctx, "name", "GoFrame")
116116

117117
// 发送HTTP请求
118-
response, err := g.Client().Get(ctx, "http://127.0.0.1:8199/hello")
118+
response, err := g.Client().Get(ctx, "http://127.0.0.1:8000/hello")
119119
```

observability/trace/http/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525

2626
// Service configuration constants
2727
const (
28-
serviceName = "otlp-http-client" // Name of the service for tracing
28+
serviceName = "otlp-http-client" // Name of the service for tracing
2929
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // Tracing endpoint
3030
path = "adapt_******_******/api/otlp/traces" // Tracing path
3131
)
@@ -60,7 +60,7 @@ func StartRequests() {
6060
ctx = gtrace.SetBaggageValue(ctx, "name", "GoFrame")
6161

6262
// Make HTTP request with tracing
63-
response, err := g.Client().Get(ctx, "http://127.0.0.1:8199/hello")
63+
response, err := g.Client().Get(ctx, "http://127.0.0.1:8000/hello")
6464
if err != nil {
6565
g.Log().Error(ctx, err)
6666
return

observability/trace/http/server/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
// Service configuration constants
2828
const (
29-
serviceName = "otlp-http-server" // Name of the service for tracing
29+
serviceName = "otlp-http-server" // Name of the service for tracing
3030
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // Tracing endpoint
3131
path = "adapt_******_******/api/otlp/traces" // Tracing path
3232
)
@@ -47,7 +47,7 @@ func main() {
4747
s.Group("/", func(group *ghttp.RouterGroup) {
4848
group.GET("/hello", HelloHandler)
4949
})
50-
s.SetPort(8199)
50+
s.SetPort(8000)
5151
s.Run()
5252
}
5353

observability/trace/otlp/grpc/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424

2525
// Service configuration constants for gRPC-based trace export
2626
const (
27-
serviceName = "otlp-grpc-client" // Name of the service for tracing
27+
serviceName = "otlp-grpc-client" // Name of the service for tracing
2828
endpoint = "tracing-analysis-dc-bj.aliyuncs.com:8090" // gRPC endpoint for trace collection
29-
traceToken = "******_******" // Authentication token for gRPC connection
29+
traceToken = "******_******" // Authentication token for gRPC connection
3030
)
3131

3232
// main initializes the gRPC trace exporter and starts the application.
@@ -62,6 +62,6 @@ func StartRequests() {
6262
ctx = gtrace.SetBaggageValue(ctx, "name", "john")
6363

6464
// Make HTTP request with tracing
65-
content := g.Client().GetContent(ctx, "http://127.0.0.1:8199/hello")
65+
content := g.Client().GetContent(ctx, "http://127.0.0.1:8000/hello")
6666
g.Log().Print(ctx, content)
6767
}

observability/trace/otlp/http/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424

2525
// Service configuration constants for HTTP-based trace export
2626
const (
27-
serviceName = "otlp-http-client" // Name of the service for tracing
28-
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // HTTP endpoint for trace collection
29-
path = "adapt_******_******/api/otlp/traces" // HTTP path for trace data submission
27+
serviceName = "otlp-http-client" // Name of the service for tracing
28+
endpoint = "tracing-analysis-dc-hz.aliyuncs.com" // HTTP endpoint for trace collection
29+
path = "adapt_******_******/api/otlp/traces" // HTTP path for trace data submission
3030
)
3131

3232
// main initializes the HTTP trace exporter and starts the application.
@@ -62,6 +62,6 @@ func StartRequests() {
6262
ctx = gtrace.SetBaggageValue(ctx, "name", "john")
6363

6464
// Make HTTP request with tracing
65-
content := g.Client().GetContent(ctx, "http://127.0.0.1:8199/hello")
65+
content := g.Client().GetContent(ctx, "http://127.0.0.1:8000/hello")
6666
g.Log().Print(ctx, content)
6767
}

observability/trace/provider/internal/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func StartRequests() {
2929
ctx = gtrace.SetBaggageValue(ctx, "name", "john")
3030

3131
// Make HTTP request with trace context propagation
32-
content := g.Client().GetContent(ctx, "http://127.0.0.1:8199/hello")
32+
content := g.Client().GetContent(ctx, "http://127.0.0.1:8000/hello")
3333

3434
// Log response with trace context
3535
g.Log().Print(ctx, content)

0 commit comments

Comments
 (0)