Kong / Kong/ngx_wasm_module

Support c++ sdk

Open
#680 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
142
Forks
16
PR merge metrics
No merged PRs in 30d

Description

The wasm go sdk has been deprecated, that repo owner recommends to using c++/rust sdk.
I have tested the example of c++ sdk repo, it's not work. The nginx has loaded my wasm plugin (log in error.log), but it not printed log message in functions, just like instances of my plugin has not be registered. The sdk provides an instance registration mechanism, but the strange thing is that after I commented out this line of code, the proxy behavior of nginx did not change at all, and neither did the error.log

[example](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/main/example/http_wasm_example.cc)

[registration mechanism](https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/blob/main/docs/api_overview.md#registering-contexts)

nginx.conf:
```
worker_processes auto;
error_log error.log info;

events {}

wasm {
backtraces on;
module request_recorder /home/zhangnf/workspace/codes/cpp/proxy-wasm-cpp-sdk/artifact/http_wasm_example.wasm;
}

http {
server {
listen 19052;

location / {
proxy_wasm request_recorder;
proxy_pass http://bing.com;
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the provided nginx.conf and the example/http_wasm_example.cc example. Read the registration mechanism in docs/api_overview.md, then inspect error.log while testing whether the configured request_recorder instance receives requests. Done means the C++ SDK example is registered and its function log messages appear through the nginx module.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, nginx, wasm
Domain
backend, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.