Skip to content

Commit 00f2d49

Browse files
committed
gzip proxy.pac
1 parent 78b49a5 commit 00f2d49

File tree

8 files changed

+38
-3803
lines changed

8 files changed

+38
-3803
lines changed

Diff for: .gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "NSData-Base64"]
1414
path = NSData-Base64
1515
url = https://github.com/l4u/NSData-Base64.git
16+
[submodule "GZIP"]
17+
path = GZIP
18+
url = https://github.com/nicklockwood/GZIP.git

Diff for: GZIP

Submodule GZIP added at 18b7cc6

Diff for: ShadowWeb/SWBAppDelegate.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88
#import <Crashlytics/Crashlytics.h>
99

10+
#import "GZIP.h"
1011
#import "AppProxyCap.h"
1112
#import "SWBAppDelegate.h"
1213

@@ -53,7 +54,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
5354
// [self proxyHttpStart];
5455
// [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(updatePolipo) userInfo:nil repeats:YES];
5556

56-
NSData *pacData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"proxy" withExtension:@"pac"]];
57+
NSData *pacData = [[NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"proxy" withExtension:@"pac.gz"]] gunzippedData];
5758
GCDWebServer *webServer = [[GCDWebServer alloc] init];
5859
[webServer addHandlerForMethod:@"GET" path:@"/proxy.pac" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse *(GCDWebServerRequest *request) {
5960
return [GCDWebServerDataResponse responseWithData:pacData contentType:@"application/x-ns-proxy-autoconfig"];

Diff for: ShadowsocksX/SWBAppDelegate.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import <SystemConfiguration/SystemConfiguration.h>
10+
#import "GZIP.h"
1011
#import "SWBConfigWindowController.h"
1112
#import "SWBAppDelegate.h"
1213
#import "GCDWebServer.h"
@@ -30,7 +31,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
3031
[self runProxy];
3132
});
3233

33-
NSData *pacData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"proxy" withExtension:@"pac"]];
34+
NSData *pacData = [[NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"proxy" withExtension:@"pac.gz"]] gunzippedData];
3435
GCDWebServer *webServer = [[GCDWebServer alloc] init];
3536
[webServer addHandlerForMethod:@"GET" path:@"/proxy.pac" requestClass:[GCDWebServerRequest class] processBlock:^GCDWebServerResponse *(GCDWebServerRequest *request) {
3637
return [GCDWebServerDataResponse responseWithData:pacData contentType:@"application/x-ns-proxy-autoconfig"];

Diff for: ShadowsocksX/proxy.pac

-3,795
This file was deleted.

Diff for: ShadowsocksX/proxy.pac.gz

-35.8 KB
Binary file not shown.

Diff for: proxy.pac.gz

35.8 KB
Binary file not shown.

Diff for: shadowsocks.xcodeproj/project.pbxproj

+30-6
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@
109109
62D85AB5176DAA7200FE5575 /* silence.wav in Resources */ = {isa = PBXBuildFile; fileRef = 62D85AB3176DAA7200FE5575 /* silence.wav */; };
110110
62DAB9E0177A11D7003DFFDE /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 62DAB9DF177A11D7003DFFDE /* Crashlytics.framework */; };
111111
62DE796018B2140D00277174 /* cancel.png in Resources */ = {isa = PBXBuildFile; fileRef = 62DE795F18B2140D00277174 /* cancel.png */; };
112-
62E27E5118C1CE590086033D /* proxy.pac in Resources */ = {isa = PBXBuildFile; fileRef = 62E27E5018C1CE590086033D /* proxy.pac */; };
113-
62E27E5218C1CE590086033D /* proxy.pac in Resources */ = {isa = PBXBuildFile; fileRef = 62E27E5018C1CE590086033D /* proxy.pac */; };
112+
62E27E5418C1D03D0086033D /* proxy.pac.gz in Resources */ = {isa = PBXBuildFile; fileRef = 62E27E5318C1D03D0086033D /* proxy.pac.gz */; };
113+
62E27E5518C1D03D0086033D /* proxy.pac.gz in Resources */ = {isa = PBXBuildFile; fileRef = 62E27E5318C1D03D0086033D /* proxy.pac.gz */; };
114+
62E27E5918C1D0CF0086033D /* GZIP.m in Sources */ = {isa = PBXBuildFile; fileRef = 62E27E5818C1D0CF0086033D /* GZIP.m */; };
115+
62E27E5A18C1D0CF0086033D /* GZIP.m in Sources */ = {isa = PBXBuildFile; fileRef = 62E27E5818C1D0CF0086033D /* GZIP.m */; };
116+
62E27E5C18C1D0F90086033D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E27E5B18C1D0F80086033D /* libz.dylib */; };
117+
62E27E5E18C1D1000086033D /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 62E27E5D18C1D1000086033D /* libz.dylib */; };
114118
96D80C05176CE1D7006C8078 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96D80C04176CE1D7006C8078 /* AVFoundation.framework */; };
115119
EB18906527B59E4F6A70A14A /* ShadowsocksRunner.m in Sources */ = {isa = PBXBuildFile; fileRef = EB1897A89055A4C2CFD81AF8 /* ShadowsocksRunner.m */; };
116120
EB189096BC8B91FA0F60A34C /* 3gnet_disable.mobileconfig in Resources */ = {isa = PBXBuildFile; fileRef = EB1897AD03717EB5E44BA24B /* 3gnet_disable.mobileconfig */; };
@@ -365,7 +369,11 @@
365369
62D85AB3176DAA7200FE5575 /* silence.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = silence.wav; sourceTree = "<group>"; };
366370
62DAB9DF177A11D7003DFFDE /* Crashlytics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Crashlytics.framework; sourceTree = "<group>"; };
367371
62DE795F18B2140D00277174 /* cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cancel.png; sourceTree = "<group>"; };
368-
62E27E5018C1CE590086033D /* proxy.pac */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = proxy.pac; sourceTree = "<group>"; };
372+
62E27E5318C1D03D0086033D /* proxy.pac.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = proxy.pac.gz; sourceTree = SOURCE_ROOT; };
373+
62E27E5718C1D0CF0086033D /* GZIP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GZIP.h; path = GZIP/GZIP/GZIP.h; sourceTree = SOURCE_ROOT; };
374+
62E27E5818C1D0CF0086033D /* GZIP.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GZIP.m; path = GZIP/GZIP/GZIP.m; sourceTree = SOURCE_ROOT; };
375+
62E27E5B18C1D0F80086033D /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
376+
62E27E5D18C1D1000086033D /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; };
369377
96D80C04176CE1D7006C8078 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
370378
EB189069EF341E65B5414D00 /* QRCodeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QRCodeViewController.h; sourceTree = "<group>"; };
371379
EB1891B68FCBD841C5E461B6 /* About.md */ = {isa = PBXFileReference; lastKnownFileType = file.md; path = About.md; sourceTree = SOURCE_ROOT; };
@@ -391,6 +399,7 @@
391399
isa = PBXFrameworksBuildPhase;
392400
buildActionMask = 2147483647;
393401
files = (
402+
62E27E5C18C1D0F90086033D /* libz.dylib in Frameworks */,
394403
6274847518B1FD9B00A9CDF0 /* libZXingObjC-iOS.a in Frameworks */,
395404
6274847418B1FD7900A9CDF0 /* ImageIO.framework in Frameworks */,
396405
6274847218B1FD6F00A9CDF0 /* QuartzCore.framework in Frameworks */,
@@ -423,6 +432,7 @@
423432
isa = PBXFrameworksBuildPhase;
424433
buildActionMask = 2147483647;
425434
files = (
435+
62E27E5E18C1D1000086033D /* libz.dylib in Frameworks */,
426436
629AC94018B49C33001D2771 /* SystemConfiguration.framework in Frameworks */,
427437
629AC93E18B49B97001D2771 /* Security.framework in Frameworks */,
428438
627A6E3F18B47F5400493BBC /* libcrypto.dylib in Frameworks */,
@@ -458,6 +468,8 @@
458468
621571A716CF6BCB003D96B4 /* Frameworks */ = {
459469
isa = PBXGroup;
460470
children = (
471+
62E27E5D18C1D1000086033D /* libz.dylib */,
472+
62E27E5B18C1D0F80086033D /* libz.dylib */,
461473
629AC93F18B49C33001D2771 /* SystemConfiguration.framework */,
462474
629AC93D18B49B97001D2771 /* Security.framework */,
463475
629AC93B18B49B69001D2771 /* AppKit.framework */,
@@ -490,6 +502,7 @@
490502
621571AE16CF6BCB003D96B4 /* ShadowWeb */ = {
491503
isa = PBXGroup;
492504
children = (
505+
62E27E5618C1D0C00086033D /* gzip */,
493506
6274845918B1FD4000A9CDF0 /* ZXingObjC.xcodeproj */,
494507
626C4AD818B1E338003DBE33 /* base64 */,
495508
62D85969176DA63C00FE5575 /* polipo */,
@@ -659,7 +672,7 @@
659672
627A6DFF18B47E9300493BBC /* Supporting Files */ = {
660673
isa = PBXGroup;
661674
children = (
662-
62E27E5018C1CE590086033D /* proxy.pac */,
675+
62E27E5318C1D03D0086033D /* proxy.pac.gz */,
663676
622BE4E418B7307200F22683 /* [email protected] */,
664677
622BE4E518B7307200F22683 /* menu_icon.png */,
665678
6232046F18C0719D001A30B9 /* menu_icon_disabled.png */,
@@ -813,6 +826,15 @@
813826
path = "iProxy/Frameworks/polipo-20091115";
814827
sourceTree = SOURCE_ROOT;
815828
};
829+
62E27E5618C1D0C00086033D /* gzip */ = {
830+
isa = PBXGroup;
831+
children = (
832+
62E27E5718C1D0CF0086033D /* GZIP.h */,
833+
62E27E5818C1D0CF0086033D /* GZIP.m */,
834+
);
835+
name = gzip;
836+
sourceTree = "<group>";
837+
};
816838
/* End PBXGroup section */
817839

818840
/* Begin PBXNativeTarget section */
@@ -951,6 +973,7 @@
951973
buildActionMask = 2147483647;
952974
files = (
953975
622BE4E318B6FBD700F22683 /* Images.xcassets in Resources */,
976+
62E27E5418C1D03D0086033D /* proxy.pac.gz in Resources */,
954977
621571B316CF6BCB003D96B4 /* InfoPlist.strings in Resources */,
955978
621571BB16CF6BCB003D96B4 /* Default.png in Resources */,
956979
628C3DDF18AD5AFA0090632A /* Localizable.strings in Resources */,
@@ -959,7 +982,6 @@
959982
EB189A01F66776EC1714F32D /* 3gnet_enable.mobileconfig in Resources */,
960983
62DE796018B2140D00277174 /* cancel.png in Resources */,
961984
62D85AB4176DAA7200FE5575 /* polipo.config in Resources */,
962-
62E27E5118C1CE590086033D /* proxy.pac in Resources */,
963985
62D85AB5176DAA7200FE5575 /* silence.wav in Resources */,
964986
EB189096BC8B91FA0F60A34C /* 3gnet_disable.mobileconfig in Resources */,
965987
EB1890D6331E61914013309F /* polipo_disable.config in Resources */,
@@ -976,9 +998,9 @@
976998
6232047218C0719D001A30B9 /* [email protected] in Resources */,
977999
627A6E0318B47E9300493BBC /* InfoPlist.strings in Resources */,
9781000
6232047818C08E2A001A30B9 /* ConfigWindow.xib in Resources */,
1001+
62E27E5518C1D03D0086033D /* proxy.pac.gz in Resources */,
9791002
622BE4E618B7307200F22683 /* [email protected] in Resources */,
9801003
6232047118C0719D001A30B9 /* menu_icon_disabled.png in Resources */,
981-
62E27E5218C1CE590086033D /* proxy.pac in Resources */,
9821004
627A6E1118B47E9300493BBC /* Images.xcassets in Resources */,
9831005
622BE4E718B7307200F22683 /* menu_icon.png in Resources */,
9841006
);
@@ -1044,6 +1066,7 @@
10441066
62D85A9C176DA6FC00FE5575 /* http.c in Sources */,
10451067
62D85A9D176DA6FC00FE5575 /* http_parse.c in Sources */,
10461068
62D85A9F176DA6FC00FE5575 /* io.c in Sources */,
1069+
62E27E5918C1D0CF0086033D /* GZIP.m in Sources */,
10471070
62D85AA0176DA6FC00FE5575 /* local.c in Sources */,
10481071
626C4ADB18B1E352003DBE33 /* NSData+Base64.m in Sources */,
10491072
62D85AA2176DA6FC00FE5575 /* log.c in Sources */,
@@ -1078,6 +1101,7 @@
10781101
isa = PBXSourcesBuildPhase;
10791102
buildActionMask = 2147483647;
10801103
files = (
1104+
62E27E5A18C1D0CF0086033D /* GZIP.m in Sources */,
10811105
629AC93418B49676001D2771 /* GCDWebServer.m in Sources */,
10821106
629AC93518B49676001D2771 /* GCDWebServerConnection.m in Sources */,
10831107
629AC93618B49676001D2771 /* GCDWebServerRequest.m in Sources */,

0 commit comments

Comments
 (0)