Skip to content

Commit

Permalink
修复传入socket查询完毕后读写超时,一只企鹅狗司马
Browse files Browse the repository at this point in the history
  • Loading branch information
ppma committed Dec 19, 2020
1 parent 0471827 commit 0e1f35a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

## 介绍

[nat-type](/ppma/nat-type)[RFC 3489][1]
[nat-type]()[RFC 3489][1]
的go实现,从 [NatTypeDetector](https://github.com/cdnbye/NatTypeDetector) 移植而来。
代码写得烂,思想跟不上,就这样了
代码写得烂,思想跟不上,就这样了,补上一句一只企鹅狗司马

## 使用

Expand All @@ -33,7 +33,7 @@ func main() {
fmt.Println(err)
return
}
fmt.Println("Nat type: ", stun.result.GetNatType())
fmt.Println("Public IP: ", stun.result.GetIpAddr())
fmt.Println("Nat type: ", result.GetNatType())
fmt.Println("Public IP: ", result.GetIpAddr())
}
```
29 changes: 15 additions & 14 deletions attributetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ package stun
type AttributeType int

const (
MappedAddress AttributeType = 0x0001
ResponseAddress AttributeType = 0x0002
ChangeRequest AttributeType = 0x0003
SourceAddress AttributeType = 0x0004
ChangedAddress AttributeType = 0x0005
Username AttributeType = 0x0006
Password AttributeType = 0x0007
MessageIntegrity AttributeType = 0x0008
ErrorCode AttributeType = 0x0009
UnknownAttribute AttributeType = 0x000A
ReflectedFrom AttributeType = 0x000B
XorMappedAddress AttributeType = 0x8020
XorOnly AttributeType = 0x0021
ServerName AttributeType = 0x8022
Undefined AttributeType = iota
MappedAddress
ResponseAddress
ChangeRequest
SourceAddress
ChangedAddress
Username
Password
MessageIntegrity
ErrorCode
UnknownAttribute
ReflectedFrom
XorMappedAddress
XorOnly
ServerName
)

0 comments on commit 0e1f35a

Please sign in to comment.