Changed default port to 80 on iOS but still 8080 on Mac & iOS Simulator
This commit is contained in:
@ -50,7 +50,7 @@ NSDictionary* GCDWebServerParseURLEncodedForm(NSString* form);
|
|||||||
- (void)addHandlerWithMatchBlock:(GCDWebServerMatchBlock)matchBlock processBlock:(GCDWebServerProcessBlock)processBlock;
|
- (void)addHandlerWithMatchBlock:(GCDWebServerMatchBlock)matchBlock processBlock:(GCDWebServerProcessBlock)processBlock;
|
||||||
- (void)removeAllHandlers;
|
- (void)removeAllHandlers;
|
||||||
|
|
||||||
- (BOOL)start; // Default is 8080 port and computer name
|
- (BOOL)start; // Default is port 8080 (Mac & iOS Simulator) or 80 (iOS) and computer name
|
||||||
- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name; // Pass nil name to disable Bonjour or empty string to use computer name
|
- (BOOL)startWithPort:(NSUInteger)port bonjourName:(NSString*)name; // Pass nil name to disable Bonjour or empty string to use computer name
|
||||||
- (void)stop;
|
- (void)stop;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@ -34,6 +34,11 @@
|
|||||||
|
|
||||||
#import "GCDWebServerPrivate.h"
|
#import "GCDWebServerPrivate.h"
|
||||||
|
|
||||||
|
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
|
||||||
|
#define kDefaultPort 80
|
||||||
|
#else
|
||||||
|
#define kDefaultPort 8080
|
||||||
|
#endif
|
||||||
#define kMaxPendingConnections 16
|
#define kMaxPendingConnections 16
|
||||||
|
|
||||||
@interface GCDWebServer () {
|
@interface GCDWebServer () {
|
||||||
@ -190,7 +195,7 @@ static void _SignalHandler(int signal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)start {
|
- (BOOL)start {
|
||||||
return [self startWithPort:8080 bonjourName:@""];
|
return [self startWithPort:kDefaultPort bonjourName:@""];
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _NetServiceClientCallBack(CFNetServiceRef service, CFStreamError* error, void* info) {
|
static void _NetServiceClientCallBack(CFNetServiceRef service, CFStreamError* error, void* info) {
|
||||||
|
|||||||
Reference in New Issue
Block a user