1 // Package version provides default versions, user-agents etc. for client identification.
11 DefaultExtendedHandshakeClientVersion string
12 // This should be updated when client behaviour changes in a way that other peers could care
14 DefaultBep20Prefix = "-GT0003-"
15 DefaultHttpUserAgent string
21 longNamespace = "anacrolix"
22 longPackageName = "torrent"
26 thisPkg := reflect.TypeOf(newtype).PkgPath()
29 mainVersion = "unknown"
30 torrentVersion = "unknown"
32 if buildInfo, ok := debug.ReadBuildInfo(); ok {
33 mainPath = buildInfo.Main.Path
34 mainVersion = buildInfo.Main.Version
35 // Note that if the main module is the same as this module, we get a version of "(devel)".
36 for _, dep := range append(buildInfo.Deps, &buildInfo.Main) {
37 if dep.Path == thisPkg {
38 torrentVersion = dep.Version
42 DefaultExtendedHandshakeClientVersion = fmt.Sprintf(
50 DefaultUpnpId = fmt.Sprintf("%v %v", mainPath, mainVersion)
51 // Per https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#library_and_net_tool_ua_strings
52 DefaultHttpUserAgent = fmt.Sprintf(