edge-core-js 2.34.0 → 2.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/android/build.gradle +10 -16
- package/android/src/main/cpp/CMakeLists.txt +3 -0
- package/lib/flow/webby.js +35 -0
- package/package.json +1 -1
- package/src/types/webby.js +33 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -5,7 +5,7 @@ buildscript {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
dependencies {
|
|
8
|
-
classpath 'com.android.tools.build:gradle:3.
|
|
8
|
+
classpath 'com.android.tools.build:gradle:7.3.1'
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -15,25 +15,19 @@ def safeExtGet(prop, fallback) {
|
|
|
15
15
|
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
def DEFAULT_COMPILE_SDK_VERSION = 28
|
|
19
|
-
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.2'
|
|
20
|
-
def DEFAULT_MIN_SDK_VERSION = 19
|
|
21
|
-
def DEFAULT_TARGET_SDK_VERSION = 27
|
|
22
|
-
def DEFAULT_WEBKIT_VERSION = '1.4.0'
|
|
23
|
-
|
|
24
18
|
android {
|
|
25
|
-
namespace "app.edge.reactnative.core"
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
namespace = "app.edge.reactnative.core"
|
|
20
|
+
compileSdk = safeExtGet('compileSdkVersion', 31)
|
|
21
|
+
ndkVersion = safeExtGet('ndkVersion', '28.0.2')
|
|
28
22
|
|
|
29
23
|
defaultConfig {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
versionCode 1
|
|
33
|
-
versionName '1.0'
|
|
24
|
+
minSdk = safeExtGet('minSdkVersion', 19)
|
|
25
|
+
targetSdk = safeExtGet('targetSdkVersion', 34)
|
|
26
|
+
versionCode = 1
|
|
27
|
+
versionName = '1.0'
|
|
34
28
|
}
|
|
35
29
|
lintOptions {
|
|
36
|
-
abortOnError false
|
|
30
|
+
abortOnError = false
|
|
37
31
|
}
|
|
38
32
|
externalNativeBuild {
|
|
39
33
|
cmake {
|
|
@@ -45,7 +39,7 @@ android {
|
|
|
45
39
|
repositories {
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
def webkit_version = safeExtGet('webkitVersion',
|
|
42
|
+
def webkit_version = safeExtGet('webkitVersion', '1.4.0')
|
|
49
43
|
|
|
50
44
|
dependencies {
|
|
51
45
|
implementation "androidx.webkit:webkit:$webkit_version"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @flow
|
|
2
|
+
|
|
3
|
+
import { Buffer } from "buffer";
|
|
4
|
+
import http from "http";
|
|
5
|
+
import { createProxyServer } from "http-proxy";
|
|
6
|
+
|
|
7
|
+
const proxy = createProxyServer({});
|
|
8
|
+
|
|
9
|
+
// Rust WebDAV server running on port 3000
|
|
10
|
+
const WEBDAV_TARGET = "http://localhost:3000";
|
|
11
|
+
const OTHER_TARGET = "http://localhost:4000";
|
|
12
|
+
|
|
13
|
+
const AUTH_USER = "william";
|
|
14
|
+
const AUTH_PASS = "hunter2";
|
|
15
|
+
|
|
16
|
+
const mainServer = http.createServer((req, res) => {
|
|
17
|
+
if (isAuthorized(req)) {
|
|
18
|
+
proxy.web(req, res, { target: WEBDAV_TARGET });
|
|
19
|
+
} else {
|
|
20
|
+
proxy.web(req, res, { target: OTHER_TARGET });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
mainServer.listen(8080, () => {
|
|
25
|
+
console.log("Node proxy running on port 8080");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function isAuthorized(req) {
|
|
29
|
+
const authHeader = req.headers.authorization;
|
|
30
|
+
if (!authHeader || !authHeader.startsWith("Basic ")) return false;
|
|
31
|
+
|
|
32
|
+
const encoded = authHeader.slice(6);
|
|
33
|
+
const decoded = Buffer.from(encoded, "base64").toString("utf8");
|
|
34
|
+
return decoded === `${AUTH_USER}:${AUTH_PASS}`;
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Buffer } from 'buffer'
|
|
2
|
+
import http from 'http'
|
|
3
|
+
import { createProxyServer } from 'http-proxy'
|
|
4
|
+
|
|
5
|
+
const proxy = createProxyServer({})
|
|
6
|
+
|
|
7
|
+
// Rust WebDAV server running on port 3000
|
|
8
|
+
const WEBDAV_TARGET = 'http://localhost:3000'
|
|
9
|
+
const OTHER_TARGET = 'http://localhost:4000'
|
|
10
|
+
|
|
11
|
+
const AUTH_USER = 'william'
|
|
12
|
+
const AUTH_PASS = 'hunter2'
|
|
13
|
+
|
|
14
|
+
const mainServer = http.createServer((req, res) => {
|
|
15
|
+
if (isAuthorized(req)) {
|
|
16
|
+
proxy.web(req, res, { target: WEBDAV_TARGET })
|
|
17
|
+
} else {
|
|
18
|
+
proxy.web(req, res, { target: OTHER_TARGET })
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
mainServer.listen(8080, () => {
|
|
23
|
+
console.log('Node proxy running on port 8080')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
function isAuthorized(req) {
|
|
27
|
+
const authHeader = req.headers.authorization
|
|
28
|
+
if (!authHeader || !authHeader.startsWith('Basic ')) return false
|
|
29
|
+
|
|
30
|
+
const encoded = authHeader.slice(6)
|
|
31
|
+
const decoded = Buffer.from(encoded, 'base64').toString('utf8')
|
|
32
|
+
return decoded === `${AUTH_USER}:${AUTH_PASS}`
|
|
33
|
+
}
|