Questions tagged [gcdwebserver]

Lightweight GCD based HTTP server for OS X & iOS (includes web based uploader & WebDAV server)

GCDWebServer is a modern and lightweight GCD based HTTP 1.1 server designed to be embedded in OS X & iOS apps.

See https://github.com/swisspol/GCDWebServer for details.

104 questions
2
votes
0 answers

how to create url of image inside the app using swift

I hv a small app which shows iPhones videos and images in the app. Now when I access any photo or video, I want to generate its http url using GCDWebServer (e.g. http://my-device.local/photo-12-2019.jpg) I came across this link…
janubhai
  • 183
  • 1
  • 8
2
votes
3 answers

How to configure a proxy to support cross-origin requests with GCDWebServer

I am rendering local web content on a WKWebView using a local server of GCDWebServer, but I have a cross-origin request due to cookies sitting in the backend. how could I configure a proxy that will solve this problem. NOTE: I have try'd to…
Hudi Ilfeld
  • 1,905
  • 2
  • 16
  • 25
2
votes
1 answer

GCDWebservers background mode not working on device

I'm using GCDWebservers to start a http service. I want it still accept connections in background mode. This is my source code: func startServer (){ do { webServer?.stop() webServer?.removeAllHandlers() try…
Quang Hà
  • 4,613
  • 3
  • 24
  • 40
2
votes
4 answers

GDCWebserver serverURL is null when wifi is turned off

I am not accessing from a different network. I am just trying to serve files for a hybrid app. Just running the basic server works as intended when I am connected to a wifi network using the code below: let webServer = GCDWebServer() …
yeahdixon
  • 6,647
  • 1
  • 41
  • 43
2
votes
1 answer

GCDWebServer - Static files from Documents

I'm using GCDWebServer to create a HTTP server on my device. The actual content for the webpage is placed inside the Documents folder of the my App. The content contains a HTML file with a referred css and png file. The problem is that the css and…
Sebastian
  • 3,379
  • 2
  • 23
  • 39
2
votes
3 answers

GCDWebServer static website issue

I am using GCDWebServer cocoapod and trying to start static code : GCDWebServer* webServer = [[GCDWebServer alloc] init]; [webServer addGETHandlerForBasePath:@"/" directoryPath:NSHomeDirectory() indexFilename:nil cacheAge:3600…
2
votes
3 answers

How to make a server running in background

I´ve read the question about how to open a mobileconfig file stored in the app (Unable to open mobileconfig file in Safari ios devices[resolved]) I need to do the same in my app but i dont know how to make a server running in background I´ve tried…
1
vote
0 answers

Migrating from GCDWebServer to Vapor

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…
Michael Jajou
  • 312
  • 2
  • 13
1
vote
0 answers

how to transfer parameters after redirect to index.html?

GCDWebServer *_webServer = [[GCDWebServer alloc] init]; [_webServer addHandlerForMethod:@"GET" path:@"/" requestClass:[GCDWebServerRequest class] …
Ronaldo
  • 11
  • 3
1
vote
1 answer

iOS -WKWebView - load content from local host directory/files (.js and assets)

I want to run a local HTML file in a WKWebView. Then I want to use some local files (.js and assets) from a local directory located in the app bundle or from a path in the app documents directory Then serve them on my localHost. It looks like I…
1
vote
1 answer

SwiftUI: what is the equivalent stuff with viewDidLoad and viewWillDisappear

I used to put GCDWebServer's start() and stop() in viewDidLoad and viewWillDisappear. Now in SwiftUI, what is the equivalent place should I put them to? I try to put server init() into scene(_ scene: UIScene, willConnectTo, and server deinit() in…
Zhou Haibo
  • 1,681
  • 1
  • 12
  • 32
1
vote
0 answers

Failed "Dictionary.subscript.getter" all within same dispatchQueue

I have a handful of production crashes on iOS that look like this: Crashed: com.superdupertango.Server.CallbackRunQueue 0 SDTServer 0x102b78ed0 specialized Dictionary.subscript.getter + 4378562256…
SuperDuperTango
  • 1,398
  • 1
  • 14
  • 32
1
vote
0 answers

load local file in webview ios using http protocol. (Create Webview server in android and iOS)

Is there any way to create the server in android and iOS to run a web-view? I want to run a local HTML file in a web-view with a local-host URL. I have already searched for this on the following links but could not find any solution.…
1
vote
1 answer

Starting a GCDWebServer in a macOS/Cocoa app freezes the app

When I start a simple GCDWebServer server from a macOS/Cocoa app (not command line) the app freezes ("Application Not Responding" + beach ball). In AppDelegate:applicationDidFinishLaunching method: let webServer =…
dtrenz
  • 599
  • 6
  • 14
1
vote
2 answers

Two path for different local resources in GCDWebServer

I need to initialize a GCDWebServer with two paths for different local resources (HTML5 games). Now I can create a path only for one resource with addGETHandler. This handler can be used once if you will use it again, the old handler will be…
MrTishman
  • 77
  • 7