Skip to content

Commit

Permalink
update modles
Browse files Browse the repository at this point in the history
  • Loading branch information
YouROK committed Mar 15, 2021
1 parent 9a8793e commit ccc1cde
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 4 additions & 4 deletions server/go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module server

replace github.com/anacrolix/torrent v1.2.5 => github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747
replace github.com/anacrolix/torrent v1.2.6 => github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436

go 1.16

require (
github.com/alexflint/go-arg v1.3.0
github.com/anacrolix/missinggo v1.1.0
github.com/anacrolix/torrent v1.2.5
github.com/anacrolix/torrent v1.2.6
github.com/gin-contrib/cors v1.3.1
github.com/gin-gonic/gin v1.6.3
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4
github.com/pkg/errors v0.8.1
go.etcd.io/bbolt v1.3.5
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
)

go 1.16
7 changes: 2 additions & 5 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ github.com/anacrolix/missinggo v0.2.1-0.20190310234110-9fbdc9f242a8/go.mod h1:MB
github.com/anacrolix/missinggo v1.1.0 h1:0lZbaNa6zTR1bELAIzCNmRGAtkHuLDPJqTiTtXoAIx8=
github.com/anacrolix/missinggo v1.1.0/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo=
github.com/anacrolix/mmsg v0.0.0-20180515031531-a4a3ba1fc8bb/go.mod h1:x2/ErsYUmT77kezS63+wzZp8E3byYB0gzirM/WMBLfw=
github.com/anacrolix/mmsg v0.0.0-20180808012353-5adb2c1127c0/go.mod h1:x8kRaJY/dCrY9Al0PEcj1mb/uFHwP6GCJ9fLl4thEPc=
github.com/anacrolix/sync v0.0.0-20171108081538-eee974e4f8c1/go.mod h1:+u91KiUuf0lyILI6x3n/XrW7iFROCZCG+TjgK8nW52w=
github.com/anacrolix/sync v0.0.0-20180611022320-3c4cb11f5a01/go.mod h1:+u91KiUuf0lyILI6x3n/XrW7iFROCZCG+TjgK8nW52w=
github.com/anacrolix/sync v0.0.0-20180808010631-44578de4e778 h1:XpCDEixzXOB8yaTW/4YBzKrJdMcFI0DzpPTYNv75wzk=
Expand Down Expand Up @@ -114,7 +113,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
Expand Down Expand Up @@ -169,8 +167,8 @@ github.com/willf/bitset v1.1.10/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPy
github.com/willf/bloom v0.0.0-20170505221640-54e3b963ee16/go.mod h1:MmAltL9pDMNTrvUkxdg0k0q5I0suxmuwp3KbyrZLOZ8=
github.com/willf/bloom v2.0.3+incompatible h1:QDacWdqcAUI1MPOwIQZRy9kOR7yxfyEmxX8Wdm2/JPA=
github.com/willf/bloom v2.0.3+incompatible/go.mod h1:MmAltL9pDMNTrvUkxdg0k0q5I0suxmuwp3KbyrZLOZ8=
github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747 h1:UBwB6QbdORO+ZqE5rU9Lgvo01+Q/aIGYVT1NlDi/ThI=
github.com/yourok/torrent v0.0.0-20210302124413-ade31ee47747/go.mod h1:fctmpB5/VE7vKdFmXaBYQuk9/GozmbOo7Dr7F4P/Q6s=
github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436 h1:ukGbOpJRN154bS1VemmOFAnjBhpA/dk+y4zuPN4YliM=
github.com/yourok/torrent v0.0.0-20210315105830-97ae9ed6a436/go.mod h1:yYeWT/V+KGvBCEjM176HOi5mJJ8s0foBAyRADO3dXlU=
go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand All @@ -180,7 +178,6 @@ golang.org/x/net v0.0.0-20190318221613-d196dffd7c2b h1:ZWpVMTsK0ey5WJCu+vVdfMldW
golang.org/x/net v0.0.0-20190318221613-d196dffd7c2b/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190318195719-6c81ef8f67ca/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
6 changes: 6 additions & 0 deletions server/torr/btserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,16 @@ func (bt *BTServer) configure() {
bt.config.ExtendedHandshakeClientVersion = cliVers
bt.config.EstablishedConnsPerTorrent = settings.BTsets.ConnectionsLimit

// Encryption/Obfuscation
bt.config.EncryptionPolicy = torrent.EncryptionPolicy{
ForceEncryption: settings.BTsets.ForceEncrypt,
}

// bt.config.HeaderObfuscationPolicy = torrent.HeaderObfuscationPolicy{
// RequirePreferred: settings.BTsets.ForceEncrypt,
// Preferred: true,
// }

if settings.BTsets.DhtConnectionLimit > 0 {
bt.config.ConnTracker.SetMaxEntries(settings.BTsets.DhtConnectionLimit)
}
Expand Down
3 changes: 3 additions & 0 deletions server/web/api/utils/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func ParseFile(file multipart.File) (*torrent.TorrentSpec, error) {
}

mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
Trackers: [][]string{mag.Trackers},
Expand Down Expand Up @@ -101,6 +102,7 @@ func fromHttp(url string) (*torrent.TorrentSpec, error) {
return nil, err
}
mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)

return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
Expand All @@ -124,6 +126,7 @@ func fromFile(path string) (*torrent.TorrentSpec, error) {
}

mag := minfo.Magnet(info.Name, minfo.HashInfoBytes())
// mag := minfo.Magnet(nil, &info)
return &torrent.TorrentSpec{
InfoBytes: minfo.InfoBytes,
Trackers: [][]string{mag.Trackers},
Expand Down

0 comments on commit ccc1cde

Please sign in to comment.