Skip to content

A server for registering Web Push endpoints and sending pushes using the Push API, written in Rust.

License

Notifications You must be signed in to change notification settings

linuskmr/webpush-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpush-server

A server for registering Web Push endpoints and sending pushes using the Push API, written in Rust.

Currently work in progress

Usage

Clone this repository and install Rust and Cargo:

Install OpenSSL header files needed for compilation:

sudo apt-get install libssl-dev

Push Application Keys

As described by https://docs.rs/web-push/0.10.1/web_push/struct.VapidSignatureBuilder.html

Generate a application private key pair:

openssl ecparam -name prime256v1 -genkey -noout -out private.pem

Derive the public key from the private key:

openssl ec -in private.pem -pubout -out vapid_public.pem

To get the byte form of the public key for the JavaScript client:

openssl ec -in private.pem -text -noout -conv_form uncompressed

...or a base64 encoded string, which the client should convert into byte form before using:

openssl ec -in private.pem -pubout -outform DER|tail -c 65|base64|tr '/+' '_-'|tr -d '\n'

Running

cargo run

Set logging to the debug level:

RUST_LOG=webpush_server=debug cargo run

About

A server for registering Web Push endpoints and sending pushes using the Push API, written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Languages