mirror of
https://github.com/osnr/TabFS.git
synced 2026-03-14 21:15:44 +01:00
safari: loopback restrict
This commit is contained in:
parent
78f67aa873
commit
eae9082407
2 changed files with 5 additions and 0 deletions
Binary file not shown.
|
|
@ -32,10 +32,15 @@ class TabFSService: NSObject, TabFSServiceProtocol {
|
|||
|
||||
var ws: NWListener!
|
||||
func startWs() {
|
||||
// TODO: randomly generate port and report back to caller?
|
||||
let port = NWEndpoint.Port(rawValue: 9991)!
|
||||
|
||||
let parameters = NWParameters(tls: nil)
|
||||
parameters.allowLocalEndpointReuse = true
|
||||
parameters.includePeerToPeer = true
|
||||
// for security ? so people outside your computer can't hijack TabFS at least
|
||||
parameters.requiredInterfaceType = .loopback
|
||||
|
||||
let opts = NWProtocolWebSocket.Options()
|
||||
opts.autoReplyPing = true
|
||||
parameters.defaultProtocolStack.applicationProtocols.insert(opts, at: 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue