EMQX mepee usoro nnabata njikọ HTTP
Ntughari
Nnọọ weebụsaịtị Http Nyocha ngwa mgbakwunye Http protocolHazie ngwa mgbakwunye HTTP
Jiri vi ma ọ bụ vim iji dezie faịlụ /etc/emqx/plugins/emqx_auth_http.conf. Hazie nyocha njikọ, nyocha njikwa, ma bipụta ma denye aha nyocha n'otu n'otu. A na-ekewa nhazi ahụ n'ime ihe anọ, adreesị interface HTTP, usoro arịrịọ, ụdị ọdịnaya, na arịrịọ arịrịọ. Adreesị interface na-ezo aka na adreesị HTTP. Anyị na-ejikarị GET ma ọ bụ POST maka usoro arịrịọ ahụ, a na-atụ aro POST. Thedị ọdịnaya ahụ na-ejikarị x-www-form-urlencoded. Oke arịrịọ bụ nke kachasị mkpa. N'ebe a, anyị kwesịrị ịgụnye ọdịnaya niile anyị chọrọ iji kpebie ikike a nwere ike ịlele nkọwa zuru ezu banyere mpaghara niile na ihe nrụtụ aka. N'ihe atụ anyị dị n'okpuru, adreesị ọrụ nke API anyị bụ ntinye dị n'otu.Kpọtụrụ interface interface a kapịrị ọnụ site na arụmọrụ na oke. N'ezie, anyị nwekwara ike ịmata ọdịiche dị na url ahụ, ị nwere ike ịhazigharị ya dịka o si eji gị. Agaghị akọwapụta ihe nkesa ahụ n'isiokwu a, n'ihi na ejikọtara ya na mgbagha azụmahịa. Ihe anyị ga-eme bụ ịlaghachi nsonaazụ ahụ na EMQX mgbe mkpebi ezi uche dị na ya.Ọ bụrụ na anyị chọrọ ịgafe nyocha ahụ, anyị ga-eweghachi koodu ọnọdụ HTTP 200 n'ụzọ kwesịrị ekwesị, ọ bụrụ na ọ daa. Ọ laghachiri koodu ọnọdụ HTTP 403.
auth.http.auth_req = http://127.0.0.1:80/
auth.http.auth_req.method = post
auth.http.auth_req.content_type = x-www-form-urlencoded
auth.http.auth_req.params = client_id=%c,username=%u,password=%P,action=emqx_auth:auth_req
auth.http.super_req = http://127.0.0.1:80/
auth.http.super_req.method = post
auth.http.super_req.content_type = x-www-form-urlencoded
auth.http.super_req.params = client_id=%c,username=%u,action=emqx_auth:super_req
auth.http.acl_req = http://127.0.0.1:80/
auth.http.acl_req.method = post
auth.http.acl_req.content_type = x-www-form-urlencoded
auth.http.acl_req.params = access=%A,username=%u,client_id=%c,ip=%a,topic=%t,action=emqx_auth:acl_req
Ibu HTTP Nyocha ngwa mgbakwunye
emqx_ctl plugins load emqx_auth_http
Nsonaazụ nkwado
Mgbe arụmọrụ ndị dị n'elu, anyị kwesịrị iji ndị ahịa MQTT jikọọ.Anyị na-anwa iji ndị ahịa nkịtị na ndị ahịa njikwa jikọọ na sava ahụ iji hụ ma nsonaazụ ahụ dịka atụ anya ya. Mgbe ahụ bipụta ma denye aha isiokwu iji hụ ma ikike nchịkwa ọ ga-emezu ihe anyị chọrọ. Ọ bụrụ na achọta ihe ọzọ, anyị nwere ike ihichapụ koodu sava ahụ ruo mgbe ihe niile dị mma.