Skip to content
prongbangPublic

About

Golang Authorization Websocket with JWT Example

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goauth-ws

Authorization Websocket with JWT Example

Run server

go run .

Open browser

http://localhost:8080/

Test with API

curl http://localhost:8080/device/publish?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Output

{"message":"published"}

Test with MQTTX

url: wss://broker.emqx.io:8084/mqtt
username: emqx_test
password: emqx_test
topic: device
payload: {"id":"1e4832e7-1ffa-4cf4-b9d9-0b8eff286c52","name":"Temp"}

About

Golang Authorization Websocket with JWT Example

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址