Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Permission denied error #393

Closed
epsilonxe opened this issue Oct 6, 2018 · 5 comments
Closed

Permission denied error #393

epsilonxe opened this issue Oct 6, 2018 · 5 comments
Labels

Comments

@epsilonxe
Copy link

I try with this

let webServer = GCDWebServer()
    
        webServer.addDefaultHandler(
            forMethod: "GET",
            request: GCDWebServerRequest.self,
            processBlock: { request in
                return GCDWebServerDataResponse(
                    html:"<html><body><p>Hello World</p></body></html>"
                )      
            }
        )
        
        webServer.run(withPort: 8080, bonjourName: "GCD Web Server")
        
        print("Visit \(String(describing: webServer.serverURL)) in your web browser")
    }

and get this error

[ERROR] Failed binding IPv4 listening socket: Operation not permitted (1)

I found no clue to solve this.

@swisspol
Copy link
Owner

swisspol commented Oct 9, 2018

Is that on iOS device, iOS simulator, Apple TV, tvOS simulator or Mac?

@epsilonxe
Copy link
Author

It is Mac. Thank you.

@swisspol
Copy link
Owner

What if you set the port to a different value like 8888 or even 0?

@heyvito
Copy link

heyvito commented Oct 13, 2018

@epsilonxe @swisspol Xcode enables sandboxing by default on new applications. Ensure your application's entitlements allows incoming and outgoing connections by marking the respective checkboxes in the Network section.

image

@swisspol
Copy link
Owner

@VictorGama thanks for help!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants