mirror of
https://github.com/osnr/TabFS.git
synced 2024-04-26 11:20:30 +02:00
safari: loopback restrict
This commit is contained in:
parent
78f67aa873
commit
eae9082407
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…
Reference in a new issue