Permalink
Browse files

update http proxy version

  • Loading branch information...
1 parent d714e6c commit 11aa54b0e546e7a428b22fd0e4df00c0bff0c038 @rehorn committed Apr 20, 2013
Showing with 2,371 additions and 594 deletions.
  1. +9 −1 lib/core.js
  2. +2 −0 lib/webui/liveapp.js
  3. +2 −2 lib/webui/public/index.html
  4. +5 −2 node_modules/http-proxy/lib/node-http-proxy/http-proxy.js
  5. +0 −77 node_modules/http-proxy/node_modules/colors/ReadMe.md
  6. +0 −269 node_modules/http-proxy/node_modules/colors/colors.js
  7. +0 −74 node_modules/http-proxy/node_modules/colors/example.html
  8. +0 −65 node_modules/http-proxy/node_modules/colors/example.js
  9. +0 −20 node_modules/http-proxy/node_modules/colors/package.json
  10. +0 −65 node_modules/http-proxy/node_modules/colors/test.js
  11. +4 −0 node_modules/http-proxy/node_modules/optimist/.travis.yml
  12. +3 −4 node_modules/http-proxy/node_modules/{colors/MIT-LICENSE.txt → optimist/LICENSE}
  13. +10 −0 node_modules/http-proxy/node_modules/optimist/example/bool.js
  14. +7 −0 node_modules/http-proxy/node_modules/optimist/example/boolean_double.js
  15. +7 −0 node_modules/http-proxy/node_modules/optimist/example/boolean_single.js
  16. +8 −0 node_modules/http-proxy/node_modules/optimist/example/default_hash.js
  17. +7 −0 node_modules/http-proxy/node_modules/optimist/example/default_singles.js
  18. +8 −0 node_modules/http-proxy/node_modules/optimist/example/divide.js
  19. +20 −0 node_modules/http-proxy/node_modules/optimist/example/line_count.js
  20. +29 −0 node_modules/http-proxy/node_modules/optimist/example/line_count_options.js
  21. +29 −0 node_modules/http-proxy/node_modules/optimist/example/line_count_wrap.js
  22. +4 −0 node_modules/http-proxy/node_modules/optimist/example/nonopt.js
  23. +2 −0 node_modules/http-proxy/node_modules/optimist/example/reflect.js
  24. +3 −0 node_modules/http-proxy/node_modules/optimist/example/short.js
  25. +11 −0 node_modules/http-proxy/node_modules/optimist/example/string.js
  26. +19 −0 node_modules/http-proxy/node_modules/optimist/example/usage-options.js
  27. +10 −0 node_modules/http-proxy/node_modules/optimist/example/xup.js
  28. +478 −0 node_modules/http-proxy/node_modules/optimist/index.js
  29. +1 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/.npmignore
  30. +70 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/README.markdown
  31. +10 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/center.js
  32. +3 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/example/meat.js
  33. +76 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/index.js
  34. +41 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/package.json
  35. +30 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/break.js
  36. +63 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
  37. +31 −0 node_modules/http-proxy/node_modules/optimist/node_modules/wordwrap/test/wrap.js
  38. +46 −0 node_modules/http-proxy/node_modules/optimist/package.json
  39. +487 −0 node_modules/http-proxy/node_modules/optimist/readme.markdown
  40. +71 −0 node_modules/http-proxy/node_modules/optimist/test/_.js
  41. +2 −0 node_modules/http-proxy/node_modules/optimist/test/_/argv.js
  42. +3 −0 node_modules/http-proxy/node_modules/optimist/test/_/bin.js
  43. +446 −0 node_modules/http-proxy/node_modules/optimist/test/parse.js
  44. +292 −0 node_modules/http-proxy/node_modules/optimist/test/usage.js
  45. +0 −1 node_modules/http-proxy/node_modules/utile/node_modules/.bin/ncp.cmd
  46. +5 −1 node_modules/http-proxy/node_modules/utile/node_modules/deep-equal/package.json
  47. +5 −1 node_modules/http-proxy/node_modules/utile/node_modules/i/package.json
  48. +1 −5 node_modules/http-proxy/node_modules/utile/node_modules/mkdirp/package.json
  49. +1 −1 node_modules/http-proxy/node_modules/utile/node_modules/ncp/package.json
  50. +5 −1 node_modules/http-proxy/node_modules/utile/node_modules/rimraf/package.json
  51. +1 −1 node_modules/http-proxy/node_modules/utile/package.json
  52. +4 −4 node_modules/http-proxy/package.json
View
@@ -65,6 +65,7 @@ livepool.run = function (){
var handler = config.getHandler(reqInfo);
var reqUrl = reqInfo.url;
var hostname = reqInfo.headers.host.split(':')[0];
+ console.log(req.url)
if(reqUrl.match(/localhost:8002/)){
// hack for express router & http-proxy
req.url = req.url.replace('http://localhost:8002', '');
@@ -106,6 +107,7 @@ function runLiveApp(){
// proxy https request from httpServer to httpsServer, stolen form nproxy
function proxyHttps() {
httpServer.on('connect', function(req, socket, upgradeHead) {
+ console.log(req.method)
var netClient = net.createConnection(httpsPort);
netClient.on('connect', function() {
@@ -146,7 +148,13 @@ function proxyHttps() {
function proxyWebSocket(){
httpServer.on('upgrade', function (req, socket, head) {
- proxy2Liveapp.proxyWebSocketRequest(req, socket, head);
+ console.log('upgrade');
+ console.log(req.url)
+ if(req.url.match(/localhost:8002/)){
+ // hack for express router & http-proxy
+ req.url = req.url.replace('http://localhost:8002', 'ws://localhost:8002');
+ proxy2Liveapp.proxyWebSocketRequest(req, socket, head);
+ }
});
}
@@ -30,6 +30,8 @@ liveapp.configure('development', function(){
liveapp.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
+liveapp.io.set('transports', ['websocket']);
+
liveapp.configure('production', function(){
var oneYear = 31557600000;
liveapp.use(express.static(publicPath, { maxAge: oneYear }));
@@ -10,7 +10,7 @@
<script type="text/javascript" src="vendor/extjs4/ext-all.js"></script>
<script type="text/javascript" src="js/liveapp.js"></script>
- <!-- <script src="/socket.io/socket.io.js"></script>
+ <script src="/socket.io/socket.io.js"></script>
<script>
io = io.connect();
// Emit ready event.
@@ -19,6 +19,6 @@
io.on('talk', function(data) {
alert(data.message)
})
- </script> -->
+ </script>
</body>
</html>
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 11aa54b

Please sign in to comment.