Skip to content

b-yap/actixPractice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

To run the server

cargo run --bin server

it will display the initial secret key.

To run the client

Given the initial secret key, run this locally:

cargo run --bin client_secret <secret_key>

It will allow 127.0.0.1 to connect again without the secret key. Run this command:

cargo run --bin client

Access WebSocket From Other Device

  • through secret key: ws://<server_ip_address>:8080/secret/<secret_key>

  • if the device's ip address is already in the whitelist: ws://<server_ip_address>:8080/success/

Add IP

POST http://localhost:8080/whitelist Set in the body a json:

{
    "ip_address": "<ip_address>"
}

This will respond with a newly generated secret key.

Remove IP

DELETE http://localhost:8080/whitelist Set in the body a json:

{
    "ip_address": "<ip_address>"
}

Returns true if removed successfully.

Display the whitelist

Access from another port: GET http://0.0.0.0:8090/whitelist

About

rust and actix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages