aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/HttpServer.hx6
-rw-r--r--src/server/Utils.hx4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/HttpServer.hx b/src/server/HttpServer.hx
index 0fc46fd..38cfcfe 100644
--- a/src/server/HttpServer.hx
+++ b/src/server/HttpServer.hx
@@ -6,7 +6,7 @@ import haxe.io.Path;
import js.node.Fs;
import js.node.Https;
import js.node.Http;
-import js.node.Url;
+import js.node.url.URL;
import js.node.http.IncomingMessage;
import js.node.http.ServerResponse;
import js.node.Path as JsPath;
@@ -136,12 +136,12 @@ class HttpServer {
static function proxyUrl(req:IncomingMessage, res:ServerResponse):Bool {
final url = req.url.replace("/proxy?url=", "");
- final url = Url.parse(js.Node.global.decodeURI(url));
+ final url = new URL(js.Node.global.decodeURI(url));
if (url.host == req.headers["host"]) return false;
final options = {
host: url.host,
port: Std.parseInt(url.port),
- path: url.path,
+ path: url.pathname + url.search,
method: req.method,
// headers: req.headers
};
diff --git a/src/server/Utils.hx b/src/server/Utils.hx
index ebe928b..218184d 100644
--- a/src/server/Utils.hx
+++ b/src/server/Utils.hx
@@ -1,12 +1,12 @@
package server;
-import js.node.Https;
+import js.node.Http;
import js.node.Os;
class Utils {
public static function getGlobalIp(callback:(ip:String)->Void):Void {
- Https.get("https://myexternalip.com/raw", r -> {
+ Http.get("http://myexternalip.com/raw", r -> {
r.setEncoding("utf8");
r.on("data", callback);
}).on("error", e -> {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage