File tree 2 files changed +27
-4
lines changed
2 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -27,15 +27,20 @@ the remote hostname.
27
27
Example:
28
28
29
29
```
30
- $ git-cache-http-server --port 1234 --cache-dir /tmp/cache/git &
31
- $ git clone http://localhost:1234/github.com/jonasmalacofilho/git-cache-http-server
30
+ git-cache-http-server --port 1234 --cache-dir /tmp/cache/git &
31
+ git clone http://localhost:1234/github.com/jonasmalacofilho/git-cache-http-server
32
+ ```
33
+
34
+ If you run your git-cache on a dedicated server or container (i.e. named gitcache), you can then also configure git to always use your cache like in the following example (don't use this configuration on the git-cache machine itself):.
35
+ ```
36
+ git config --global url."http://gitcache:1234/".insteadOf https:// && \
32
37
```
33
38
34
39
# Installing
35
40
36
41
Requirements: ` nodejs ` and ` git ` .
37
42
38
- Install: ` npm install -g jonasmalacofilho/ git-cache-http-server `
43
+ Install: ` npm install -g git-cache-http-server `
39
44
40
45
To install as a service, check the ` doc/git-cache-http-server.service ` example
41
46
service file.
@@ -49,6 +54,20 @@ systemctl daemon-reload
49
54
systemctl start git-cache-http-server
50
55
```
51
56
57
+ # Building from source
58
+
59
+ This is needed only if you change the Haxe source code in ` src/ ` .
60
+
61
+ Requirements: ` haxe ` and ` haxelib ` .
62
+
63
+ You'll need the "hxnodejs" and the https://github.com/jonasmalacofilho/jmf-npm-externs.hx libraries before being able to compile the project.
64
+
65
+ ```
66
+ haxelib install hxnodejs
67
+ haxelib git https://github.com/jonasmalacofilho/jmf-npm-externs.hx.git
68
+ haxe build.hxml
69
+ ```
70
+
52
71
# Implementation
53
72
54
73
The current implementation is somewhat oversimplified; any help in improving it
Original file line number Diff line number Diff line change @@ -111,7 +111,11 @@ class Main {
111
111
res .setHeader (" Content-Type" , ' application/x- ${params .service }-result' );
112
112
res .setHeader (" Cache-Control" , " no-cache" );
113
113
var up = ChildProcess .spawn (params .service , [" --stateless-rpc" , local ]);
114
- req .pipe (up .stdin );
114
+ // If we receive gzip content, we must unzip
115
+ if (req .headers [' content-encoding' ] == ' gzip' )
116
+ req .pipe (Zlib .createUnzip ()).pipe (up .stdin );
117
+ else
118
+ req .pipe (up .stdin );
115
119
up .stdout .pipe (res );
116
120
up .stderr .on (" data" , function (data ) trace ('${params .service} stderr: $data '));
117
121
up .on (" exit" , function (code ) {
You can’t perform that action at this time.
0 commit comments