a simple websocket server and client which can help remotely debug react-native applications.
# clone the project
git clone https://github.com/asleepace/rn-debugger.git
cd rn-debugger
# install dependencies and start server
npm install
npm run start
Send a POST
request to http://localhost:8082/debugger with the following format
const queue: string[] = []
const message = ['hello world!', 'argument1', 123, { foo: 'bar' }]
queue.push(message)
const encodedMessages = queue.map(item => JSON.stringify(item))
const encodedBody = JSON.stringify(encodedMessages)
fetch("http://localhost:8082/debugger", {
body: encodedBody,
method: "POST",
})
Open http://localhost:8082 in your browser and open the chrome devtools to see the following
- Yellow favicon means wating for connection
- Green favicon means receiving messages
- Red favicon means disconnected
![Screenshot 2023-09-08 at 4 21 12 PM](https://private-user-images.githubusercontent.com/10716803/266748374-d68f5c34-2ed0-4ed6-9daf-cbba0612e370.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUzMTE5MzAsIm5iZiI6MTcyNTMxMTYzMCwicGF0aCI6Ii8xMDcxNjgwMy8yNjY3NDgzNzQtZDY4ZjVjMzQtMmVkMC00ZWQ2LTlkYWYtY2JiYTA2MTJlMzcwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAyVDIxMTM1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTllYTUyNzQxMGRlMjViNDEwYTRmNDdmMDY2MTZkMmM4YzVlYjBmOWUwODBiZTM5ZGEwODczZTdhMTJmZGNhZTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.59X3A3hsqkgwCPF6Mpr8l77gOIXGO4B9LspJW_WThGg)