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

修复端口大于32767的情况下无法正常显示和无法添加的问题 #1

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/package.json.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6c7ba00b8550f05fc02d7ee5b2c2a3a6
c6780ba96b30b5bc41d0b12c1bbd890e
2 changes: 1 addition & 1 deletion port_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func NewProtocol(value string) (Protocol, error) {

type IpAddress struct {
Ip string `json:"ip"`
Port int16 `json:"port"`
Port uint16 `json:"port"`
Proto Protocol `json:"proto"`
}

Expand Down
2 changes: 1 addition & 1 deletion wails.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"info": {
"companyName": "qszdev.com",
"productName": "Port Forward",
"productVersion": "1.0.1"
"productVersion": "1.0.2"
},
"wailsjsdir": "./frontend/src"
}
8 changes: 4 additions & 4 deletions windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ func (ws WindowsPortForwarder) Get() ([]PortForward, error) {
arr1 := removeEmpty(strings.Split(portmaptext, ";"))
for _, item := range arr1 {
portMapItem := removeEmpty(strings.Split(item, " "))
sourcePort, _ := strconv.ParseInt(portMapItem[3], 10, 16)
targetPort, _ := strconv.ParseInt(portMapItem[5], 10, 16)
sourcePort, _ := strconv.ParseInt(portMapItem[3], 10, 64)
targetPort, _ := strconv.ParseInt(portMapItem[5], 10, 64)

sourceProto, err := NewProtocol(portMapItem[0])
if err != nil {
Expand All @@ -110,12 +110,12 @@ func (ws WindowsPortForwarder) Get() ([]PortForward, error) {
Source: IpAddress{
Proto: sourceProto,
Ip: portMapItem[2],
Port: int16(sourcePort),
Port: uint16(sourcePort),
},
Target: IpAddress{
Proto: targetProto,
Ip: portMapItem[4],
Port: int16(targetPort),
Port: uint16(targetPort),
},
})
}
Expand Down