Skip to content

Commit

Permalink
Merge pull request #1 from qinshuze/dev
Browse files Browse the repository at this point in the history
修复端口大于32767的情况下无法正常显示和无法添加的问题
  • Loading branch information
qinshuze authored Oct 23, 2024
2 parents dde4d00 + 2c18213 commit 5588512
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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

0 comments on commit 5588512

Please sign in to comment.