Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSURLConnectionFilterMBS class.

NSURLConnectionFilterMBS.FilterConnection(request as NSURLRequestMBS) as NSURLRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Cocoa Networking MBS MacBase Plugin 18.2 ✅ Yes ❌ No ❌ No ❌ No
The event called when a new connection is made.
Example
Function FilterConnection(request as NSURLRequestMBS) Handles FilterConnection as NSURLRequestMBS
system.debuglog CurrentMethodName
system.debuglog "URL: "+request.URL

dim newRequest as NSMutableURLRequestMBS = request.mutableCopy

// change to 10 minutes
newRequest.setTimeoutInterval 600

return newRequest
End Function

You get the current request and you can return a new request.
If you return nil, we pass through the existing one.
Only requests on main thread trigger the event.

Some examples using this event:

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...