Migrating from GCDWebServer to Vapor

327 views Asked by At

In my application, I am using GCDWebServer to run a reverse proxy server; however, it has been a couple of years since GCDWebServer has been updated, and with every iOS update, it becomes scarier to face breaking changes. Is it possible to migrate from GCDWebServer to a service like Vapor or anything else?

I really only have one main use case for GCDWebServer, which is intercepting HTTP Get Requests as such

private func addRequestHandler() {
    // Web Server - GCDWebServer()
    self.webServer.addHandler(
        forMethod: "GET",
        pathRegex: "^/.*\\\(encodingType.fileType)$",
        request: GCDWebServerRequest.self
    ) { [weak self] request, completion in
        // Handle Interception
        completion(GCDWebServerDataResponse(data: data, contentType: contentType))
    }
}
0

There are 0 answers