diff --git a/docs/plugins/build.go b/docs/plugins/build.go index 62bf940..86afdaf 100644 --- a/docs/plugins/build.go +++ b/docs/plugins/build.go @@ -265,7 +265,9 @@ func mdToHTML(md []byte) []byte { // create HTML renderer with extensions htmlFlags := html.CommonFlags | html.HrefTargetBlank - opts := html.RendererOptions{Flags: htmlFlags} + opts := html.RendererOptions{ + Flags: htmlFlags, + } renderer := html.NewRenderer(opts) return markdown.Render(doc, renderer) diff --git a/docs/plugins/cssOptimizer.go b/docs/plugins/cssOptimizer.go index 35cce02..f6147a0 100644 --- a/docs/plugins/cssOptimizer.go +++ b/docs/plugins/cssOptimizer.go @@ -38,46 +38,6 @@ func optimizeCss(htmlContent []byte) ([]byte, error) { //Replace the img with ts-image originalHTMLContent = strings.Replace(originalHTMLContent, orginalParent, "
without class with
+ for {
+ startIndex := strings.Index(originalHTMLContent, "")
+ if startIndex == -1 {
+ break
+ }
+
+ endIndex := strings.Index(originalHTMLContent[startIndex+6:], "
")
+ if endIndex == -1 {
+ break
+ }
+ endIndex += startIndex + 6
+
+ codeSegment := originalHTMLContent[startIndex : endIndex+7] // Include
+ fmt.Println(">>>>", codeSegment)
+ if !strings.Contains(codeSegment, "class=") {
+ replacement := strings.Replace(codeSegment, "", "", 1)
+ replacement = strings.Replace(replacement, "
", "", 1)
+ originalHTMLContent = strings.Replace(originalHTMLContent, codeSegment, replacement, 1)
+ } else {
+ // Skip if already has a class
+ break
+ }
+ }
+
//Replace blockquote to
originalHTMLContent = strings.ReplaceAll(originalHTMLContent, "", "")
originalHTMLContent = strings.ReplaceAll(originalHTMLContent, "", "")
diff --git a/docs/plugins/diagrams/dynamic_capture.drawio b/docs/plugins/diagrams/dynamic_capture.drawio
new file mode 100644
index 0000000..466c309
--- /dev/null
+++ b/docs/plugins/diagrams/dynamic_capture.drawio
@@ -0,0 +1 @@
+5VrRcps4FP0az2Qf1gMIAX5MnCbNbHcn00xn277syCBjpRhRIcdOvn4lkG2Q1CZxMSGpHzxwBZI49xxd3Qs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r740h44bWwGUCo2t+7PZvbxkr2BSCOAPSRxPx+k75QOmG+mRD9EqGUzrlz/BgK+C7SV6qXTOPCEFze9L1nQa7PdVnC17EaPV3AFv0Gy68H2XtTX0Ty04OpHPa8jZoJ1QdkasaQC6XsFH0rE+iA/LBhSRtHIf2FH7y6idmLn2yq9vWYYoINS79ClZChgcujGVqsbQb0AdewXuGZIPkFxjAs5x3ktqj+GJJvOykaOthiGPZaN/rq6/e/7x3+uPn0oNmw9+fhwPvvaxQcWc5JljZw7gThKfGEXmQr9hhstkTcDwb5wranKAu1QYhbs6uWGJjs9F+pOdlZfmwHs5EpEJ2f79ZGMYitcyhkvUJ5kJE8HpcJ98DIU9yTy7IKX5l1LdexowcvqGNi5COdRjOPYJsJZBGW0fg0iDMeaow4t5ATaB0vweFtHq3/NovMJ0YR3W71fHKbugm505080d9o2jTZCHaA7cbr/HrZ24/6jYvDufw==
\ No newline at end of file
diff --git a/docs/plugins/diagrams/dynamic_capture.png b/docs/plugins/diagrams/dynamic_capture.png
new file mode 100644
index 0000000..0083370
Binary files /dev/null and b/docs/plugins/diagrams/dynamic_capture.png differ
diff --git a/docs/plugins/diagrams/static_capture.drawio b/docs/plugins/diagrams/static_capture.drawio
new file mode 100644
index 0000000..b30eb4f
--- /dev/null
+++ b/docs/plugins/diagrams/static_capture.drawio
@@ -0,0 +1 @@
+5VrRjqM2FP2aSNOHRoAxhMeZzO52pW010qjqbt884AFawMg4k2S/vjaYALa3k0kDpJk8RHABY849x9fHsADrfPeJojL5lUQ4WzhWtFuA+4XjBBbk/yKwbwKe7zSBmKZRE7K7wGP6HcugJaObNMLV4ERGSMbSchgMSVHgkA1iiFKyHZ72TLLhXUsUYy3wGKJMj/6RRixpoivH7+K/4DRO2jvbXtAcyVF7snySKkER2fZC4MMCrCkhrNnKd2ucCexaXJrrPv7g6KFjFBfsmAu+7fPg6aWgfvAp/isMv37OHv2fZSsvKNvIB/6TULTbyy6zfYsDJZsiwqIpawHutknK8GOJQnF0yxP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VZqQ3FNAwSQsm1c05Xyr2TKW19FuPafaVx4rtiE9OmrI9n+dUUnpyAVNmgFB9kTL2h0i6k7zhqilJUeH5tXgO8akrZ4ZFnUltpPsODJJWa/xzyWM1sTx0z39l8nCGL/1gO904vzz4bveBd5Og7it58OEf
\ No newline at end of file
diff --git a/docs/plugins/diagrams/static_capture.png b/docs/plugins/diagrams/static_capture.png
new file mode 100644
index 0000000..0c51c52
Binary files /dev/null and b/docs/plugins/diagrams/static_capture.png differ
diff --git a/docs/plugins/docs/2. Architecture/4. Capture Modes.md b/docs/plugins/docs/2. Architecture/4. Capture Modes.md
index 3979051..de110b6 100644
--- a/docs/plugins/docs/2. Architecture/4. Capture Modes.md
+++ b/docs/plugins/docs/2. Architecture/4. Capture Modes.md
@@ -2,16 +2,26 @@
As you can see in the Introspect section, there are two types of capture mode in Zoraxy plugin API.
+
+
- Static Capture Mode
- Dynamic Capture Mode
+
+
**Notes: When this document mention the term "endpoint", it means a particular sub-path on the plugin side. For example `/capture` or `/sniff`. In actual implementation, this can be a `http.HandleFunc` or `http.Handle` depends on the plugin implementation.**
+---
+
## Static Capture Mode
-Static Capture Mode register a static path to Zoraxy, when the plugin is enalbed on a certain HTTP proxy rule, all request that matches the static capture registered paths are forwarded to the plugin without asking first.
+Static Capture Mode register a static path to Zoraxy, when the plugin is enabled on a certain HTTP proxy rule, all request that matches the static capture registered paths are forwarded to the plugin without asking first. The overall process is shown in the diagram below.
-(To be added)
+
+
+The main benefit of static capture mode is that the capture paths are stored in radix tree. That means it takes O(logn) time to resolve the path and forward the request. Hence, **this mode is generally faster** if your plugin always listens to a few certain paths for extended functionalities.
+
+---
## Dynamic Capture Mode
@@ -20,4 +30,29 @@ Dynamic Capture Mode register two endpoints to Zoraxy.
1. DynamicCaptureSniff - The sniffing endpoint where Zoraxy will first ask if the plugin want to handle this request
2. DynamicCaptureIngress - The handling endpoint, where if the plugin reply the sniffing with "YES", Zoraxy forward the incoming request to this plugin at this defined endpoint.
-(To be added)
\ No newline at end of file
+The whole process will takes a few request exchange between plugin and Zoraxy core. Since both of them are communicating via the loopback interface, speed should not be too big of a concern here.
+
+The request handling flow is shown in the diagram below.
+
+
+
+Once Zoraxy receive a request from a client that matches one of the HTTP Proxy Rule, Zoraxy will forward the request header to all the plugins that matches the following criteria
+
+1. The plugin is assigned to a tag that is currently attached to the given HTTP Proxy that the request is coming through
+2. The plugin is enabled and running
+3. The plugin has registered its dynamic capture sniffing endpoint in Introspect
+
+Then the plugin `/sniff` endpoint will receive some basic header information about the request, and response with `SniffResultAccpet` or `SniffResultSkip` to accept or reject handling such request. The response are defined in `zoraxy_plugin` as a public type where you can access with `zoraxy_plugin.SniffresultAccept` and `zoraxy_plugin.SniffResultSkip` respectively.
+
+Note that this shall only be used if static capture mode cannot satisfy your needs in implementation the feature you want, as **dynamic capture is way slower than static capture mode**.
+
+---
+
+## Mixing Capture Modes
+
+It is possible for you to mix both Static and Capture modes if that is what you want. A few thing you need to know about mixing both mode in single plugin
+
+1. Static capture mode has higher priority than dynamic capture mode across all plugins. That means if you have a request that matches Plugin A's static capture path and Plugin B's dynamic capture, the request will be first handled by Plugin A
+2. The same plugin can register both static and dynamic capture modes. Similar to item (1), if the request has already captured by your static capture path, Zoraxy will not proceed and forward the request header to your dynamic sniffing endpoint.
+3. In case there is a collision in static capture paths between two plugins, the longest one will have priority. For example, if Plugin A registered `/foo` and Plugin B registered `/foo/bar`, when a request to `/foo/bar/teacat` enter Zoraxy, Plugin B is used for handling such request.
+
diff --git a/docs/plugins/docs/2. Architecture/img/4. Capture Modes/dynamic_capture.png b/docs/plugins/docs/2. Architecture/img/4. Capture Modes/dynamic_capture.png
new file mode 100644
index 0000000..0083370
Binary files /dev/null and b/docs/plugins/docs/2. Architecture/img/4. Capture Modes/dynamic_capture.png differ
diff --git a/docs/plugins/docs/2. Architecture/img/4. Capture Modes/static_capture.png b/docs/plugins/docs/2. Architecture/img/4. Capture Modes/static_capture.png
new file mode 100644
index 0000000..0c51c52
Binary files /dev/null and b/docs/plugins/docs/2. Architecture/img/4. Capture Modes/static_capture.png differ
diff --git a/docs/plugins/html/1. Introduction/1. What is Zoraxy Plugin.html b/docs/plugins/html/1. Introduction/1. What is Zoraxy Plugin.html
index e2d36ac..490ff7d 100644
--- a/docs/plugins/html/1. Introduction/1. What is Zoraxy Plugin.html
+++ b/docs/plugins/html/1. Introduction/1. What is Zoraxy Plugin.html
@@ -110,6 +110,9 @@
Configure
+
+ Capture Modes
+
Getting Started
@@ -135,9 +138,9 @@
Zoraxy plugins are distributed as binaries, and developers have the flexibility to choose whether to open source them or not
-
+
as the plugin library and interface are open source under the LGPL license
-
+
.
@@ -146,74 +149,74 @@
There are two primary types of plugins:
-
- -
-
+
+
+
Router plugins
-
+
: Involved with connections from HTTP proxy rules.
-
- -
-
+
+
+
Utility plugins
-
+
: Provide user interfaces for various network features that operate independently of the Zoraxy core.
-
-
-
+
+
+
How plugins are distributed & installed
Zoraxy plugins are distributed as platform-dependent binaries, tailored to specific operating systems and CPU architectures. These binaries follow a naming convention that includes the operating system, CPU architecture, and plugin name, such as
-
+
linux_amd64_foobar
-
+
,
-
+
windows_amd64_foobar.exe
-
+
, or
-
+
linux_arm64_foobar
-
+
.
To manually install a plugin for testing, place the binary file into the
-
+
/plugins/{plugin_name}/
-
+
folder within your Zoraxy installation directory.
-
+
Warning:
-
+
The binary name inside the folder must match the plugin folder name. For example, the binary should be named
-
+
foobar
-
+
(or
-
+
foobar.exe
-
+
on Windows) if placed in the
-
+
/plugins/foobar/
-
+
folder. Avoid using names like
-
+
foobar_plugin.exe
-
+
.
@@ -223,58 +226,54 @@
For distribution, a plugin store system is used. The plugin store architecture is similar to the one built into the Arduino IDE, with a manager URL (a JSON file) listing all the plugins supported by that store. See the documentation section for more details on how to implement your own plugin store.
-
+
-
- Plugin vs Pull Request
-
+ Plugin vs Pull Request
The Zoraxy plugin was introduced to address specific use cases that enhance its functionality. It serves as an extension to the core Zoraxy system, providing additional features and capabilities while maintaining the integrity of the core system.
-
- -
+
+
Designed to handle features that are challenging to integrate directly into the Zoraxy core.
-
- -
+
+
Caters to scenarios where certain features are only applicable in limited situations, avoiding unnecessary resource consumption for other users.
-
- -
+
+
Allows for frequent updates to specific code components without impacting the core’s stability or causing downtime.
-
-
-
-
-
- When should you add a core PR or a plugin?
+
+
+
+ When should you add a core PR or a plugin?
In certain situations, implementing a feature as a plugin is more reasonable than directly integrating it into the Zoraxy core:
-
- -
-
+
+
+
Core PR
-
+
: If the feature is relevant to most users and enhances Zoraxy’s core functionality, consider submitting a core Pull Request (PR).
-
- -
-
+
+
+
Plugin
-
+
: If the feature is targeted at a smaller user base or requires additional dependencies that not all users need, it should be developed as a plugin.
-
-
+
+
The decision depends on the feature’s general relevance and its impact on core stability. Plugins offer flexibility without burdening the core.
diff --git a/docs/plugins/html/1. Introduction/2. Getting Started.html b/docs/plugins/html/1. Introduction/2. Getting Started.html
index aeb4921..e0b2111 100644
--- a/docs/plugins/html/1. Introduction/2. Getting Started.html
+++ b/docs/plugins/html/1. Introduction/2. Getting Started.html
@@ -110,6 +110,9 @@
Configure
+
+ Capture Modes
+
Getting Started
@@ -132,22 +135,20 @@
To start developing plugins, you will need the following installed on your computer
-
- -
+
+
The source code of Zoraxy
-
-
-
- Go compiler
-
- -
- VSCode (recommended, or any editor of your choice)
-
-
-
-
-
- Step 1: Start Zoraxy at least once
+
+ Go compiler
+
+
+ VSCode (recommended, or any editor of your choice)
+
+
+
+
+ Step 1: Start Zoraxy at least once
@@ -167,20 +168,18 @@ sudo ./zoraxy
After the startup process completes, you would see a folder named “plugins” in the working directory of Zoraxy.
-
+
-
- Steps 2: Prepare the development environment for Zoraxy Plugin
-
+ Steps 2: Prepare the development environment for Zoraxy Plugin
Next, you will need to think of a name for your plugin. Lets name our new plugin “Lapwing”.
-
+
Notes: Plugin name described in Introspect (will discuss this in later sessions) can contains space, but the folder and compiled binary filename must not contains space and special characters for platform compatibilities reasons.
-
+
@@ -189,96 +188,88 @@ sudo ./zoraxy
-
- 2.1 Create Plugin Folder
-
+ 2.1 Create Plugin Folder
Create a folder with your plugin name in the
-
+
plugins
-
+
folder. After creating the folder, you would have something like
-
+
plugins/Lapwing/
-
+
.
-
- 2.2 Locate and copy Zoraxy Plugin library
-
+ 2.2 Locate and copy Zoraxy Plugin library
Locate the Zoraxy plugin library from the Zoraxy source code. You can find the
-
+
zoraxy_plugin
-
+
Go module under
-
+
src/mod/plugins/zoraxy_plugin
-
+
.
Copy the
-
+
zoraxy_plugin
-
+
folder from the Zoraxy source code mod folder into the your plugin’s mod folder. Let assume you use the same mod folder name as Zoraxy as
-
+
mod
-
+
, then your copied library path should be
-
+
plugins/Lapwing/mod/zoraxy_plugin
-
+
.
-
- 2.3 Prepare Go Project structure
-
+ 2.3 Prepare Go Project structure
Create the
-
+
main.go
-
+
file for your plugin. In the example above, it would be located at
-
+
plugins/Lapwing/main.go
-
+
.
Use
-
+
go mod init yourdomain.com/foo/plugin_name
-
+
to initiate your plugin. By default the
-
+
go.mod
-
+
file will be automatically generated by the go compiler. Assuming you are developing Lapwing with its source located on Github, this command would be
-
+
go mod init github.com/your_user_name/Lapwing
-
+
.
-
+
-
- Steps 3: Open plugin folder in IDE
-
+ Steps 3: Open plugin folder in IDE
diff --git a/docs/plugins/html/2. Architecture/1. Plugin Architecture.html b/docs/plugins/html/2. Architecture/1. Plugin Architecture.html
index 59d4c2b..baa6b4e 100644
--- a/docs/plugins/html/2. Architecture/1. Plugin Architecture.html
+++ b/docs/plugins/html/2. Architecture/1. Plugin Architecture.html
@@ -110,6 +110,9 @@
Configure
+
+ Capture Modes
+
Getting Started
@@ -132,17 +135,17 @@
The Zoraxy Plugin uses a 3 steps approach to get information from plugin, setup the plugin and forward request to plugin. The name of the steps are partially referred from dbus designs as followings.
-
- -
+
+
Introspect
-
-
-
+
+
Configure
-
- -
+
+
Forwarding
-
-
+
+
The overall flow looks like this.
diff --git a/docs/plugins/html/2. Architecture/2. Introspect.html b/docs/plugins/html/2. Architecture/2. Introspect.html
index 62d1b0c..3e2154d 100644
--- a/docs/plugins/html/2. Architecture/2. Introspect.html
+++ b/docs/plugins/html/2. Architecture/2. Introspect.html
@@ -110,6 +110,9 @@
Configure
+
+ Capture Modes
+
Getting Started
@@ -134,22 +137,22 @@
-
+
This is a pre-defined structure where the plugin must provide to Zoraxy
-
+
when the plugin is being started with the
-
+
-introspect
-
+
flag.
The introspect structure is defined under the
-
+
zoraxy_plugin
-
+
library, where both Zoraxy and plugin should use. As of writing, the structure of introspect is like this.
@@ -200,17 +203,15 @@
SubscriptionsEvents map[string]string `json:"subscriptions_events"` //Subscriptions events of your plugin, see Zoraxy documentation for more details
}
-
To manually test if the introspect return is correct, you can try using the
-
+
-introspect
-
+
flag on any Zoraxy plugin. You should be able to see an output like so.
Configure or Configure Spec is the
-
+
exec
-
+
call where Zoraxy start the plugin. The configure spec JSON structure is defined in
-
+
zoraxy_plugin
-
+
library.
As the time of writing, the
-
+
ConfigureSpec
-
+
only contains information on some basic info.
The
-
+
ConfigureSpec
-
+
struct will be parsed to JSON and pass to your plugin via the
-
+
-configure=(json payload here)
-
+
.
In your plugin, you can use the
-
+
zoraxy_plugin
-
+
library to parse it or parse it manually (if you are developing a plugin with other languages).
+
+ As you can see in the Introspect section, there are two types of capture mode in Zoraxy plugin API. +
+ ++ + Notes: When this document mention the term “endpoint”, it means a particular sub-path on the plugin side. For example + + /capture + + or + + /sniff + + . In actual implementation, this can be a + + http.HandleFunc + + or + + http.Handle + + depends on the plugin implementation. + +
+ ++
+ Static Capture Mode register a static path to Zoraxy, when the plugin is enabled on a certain HTTP proxy rule, all request that matches the static capture registered paths are forwarded to the plugin without asking first. The overall process is shown in the diagram below. +
+ ++
+
+ The main benefit of static capture mode is that the capture paths are stored in radix tree. That means it takes O(logn) time to resolve the path and forward the request. Hence, + + this mode is generally faster + + if your plugin always listens to a few certain paths for extended functionalities. +
+ + ++
+ Dynamic Capture Mode register two endpoints to Zoraxy. +
+ ++
+ The whole process will takes a few request exchange between plugin and Zoraxy core. Since both of them are communicating via the loopback interface, speed should not be too big of a concern here. +
+ ++
+ The request handling flow is shown in the diagram below. +
+ ++
+
+ Once Zoraxy receive a request from a client that matches one of the HTTP Proxy Rule, Zoraxy will forward the request header to all the plugins that matches the following criteria +
+ ++
+ Then the plugin + + /sniff + + endpoint will receive some basic header information about the request, and response with + + SniffResultAccpet + + or + + SniffResultSkip + + to accept or reject handling such request. The response are defined in + + zoraxy_plugin + + as a public type where you can access with + + zoraxy_plugin.SniffresultAccept + + and + + zoraxy_plugin.SniffResultSkip + + respectively. +
+ ++
+ Note that this shall only be used if static capture mode cannot satisfy your needs in implementation the feature you want, as + + dynamic capture is way slower than static capture mode + + . +
+ + ++
+ It is possible for you to mix both Static and Capture modes if that is what you want. A few thing you need to know about mixing both mode in single plugin +
+ +
@@ -148,9 +147,7 @@
@@ -158,9 +155,7 @@
@@ -168,9 +163,7 @@
diff --git a/docs/plugins/index.json b/docs/plugins/index.json index b4d20c9..ca463b9 100644 --- a/docs/plugins/index.json +++ b/docs/plugins/index.json @@ -39,6 +39,11 @@ "filename": "2. Architecture/3. Configure.md", "title": "Configure", "type": "file" + }, + { + "filename": "2. Architecture/4. Capture Modes.md", + "title": "Capture Modes", + "type": "file" } ] },