Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assambar/apache2 apr #55

Closed
wants to merge 9 commits into from
Closed

Assambar/apache2 apr #55

wants to merge 9 commits into from

Conversation

gzurl
Copy link
Contributor

@gzurl gzurl commented Jun 2, 2023

Draft PR for comparison purposes

assambar and others added 9 commits May 31, 2023 15:26
     - Everything in the approach is questionable! It is just a proof of concept.
     - Several layers of translations were necessary for conversion or memory ops - will need refining
     - Edge cases like memory, cleanup, errors, etc are not well handled
     - Only a Rust Wasm filter

    Sample config

    ```
    <IfModule wasm_module>
        <Location /hello-wasm-cgi>
            SetHandler wasm-handler
            WasmModule /home/alexandrov/work/mod_wasm/examples/wasm_modules/rust-wasm/hello_wasm.wasm
            WasmPlugin /home/alexandrov/work/mod_wasm/examples/wasm_modules/rust-wasm/edit_headers.wasm
            WasmEnableCGI On
        </Location>
    </IfModule>
    ```

    Sample run

    ```
    alexandrov:~/work/mod_wasm/mod_wasm/httpd/dist/logs 16.05 10:22:00\>curl localhost:80/hello-wasm-cgi --no-progress-meter  -H "operation:add" -H `"target:hahaha" | grep HTTP
    "HTTP_HOST": "localhost"
    "HTTP_USER_AGENT": "curl/7.68.0"
    "HTTP_ACCEPT": "*/*"
    "HTTP_OPERATION": "add"
    "HTTP_TARGET": "hahaha"
    "HTTP_ADDED": "added_value"
    "SERVER_PROTOCOL": "HTTP/1.1"

    alexandrov:~/work/mod_wasm/mod_wasm/httpd/dist/logs 16.05 10:22:49\>curl localhost:80/hello-wasm-cgi --no-progress-meter  -H "operation:delete" -H "target:hahaha" | grep HTTP
    "HTTP_HOST": "localhost"
    "HTTP_USER_AGENT": "curl/7.68.0"
    "HTTP_ACCEPT": "*/*"
    "HTTP_OPERATION": "delete"
    "SERVER_PROTOCOL": "HTTP/1.1"

    alexandrov:~/work/mod_wasm/mod_wasm/httpd/dist/logs 16.05 10:22:57\>curl localhost:80/hello-wasm-cgi --no-progress-meter  -H "operation:modify" -H "target:hahaha" | grep HTTP
    "HTTP_HOST": "localhost"
    "HTTP_USER_AGENT": "curl/7.68.0"
    "HTTP_ACCEPT": "*/*"
    "HTTP_OPERATION": "modify"
    "HTTP_TARGET": "modified_value"
    "SERVER_PROTOCOL": "HTTP/1.1"
    ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants