summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorSoniEx2 <endermoneymod@gmail.com>2021-06-13 13:43:43 -0300
committerSoniEx2 <endermoneymod@gmail.com>2021-06-13 13:43:43 -0300
commit7de445737af96368dc453e8d8c04d1063982b3fd (patch)
tree9095d5589f36d21fd7214e7a7c6216e43293ca7f /src/lib.rs
parentd976180a1b00dbf6b03fc00ea54a017041ca591e (diff)
Expose the IP as a pub constHEADdefault
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b40abad..052905f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -55,6 +55,9 @@ impl Server {
}
}
+/// The IP address of the server. `"127.74.137.226"`.
+pub const IP: &'static str = "127.74.137.226";
+
/// Decodes base64 as output by the `base64` utility. Properly handles
/// 76-column base64.
fn decode_base64(s: &'static str) -> Result<Vec<u8>, base64::DecodeError> {
@@ -79,7 +82,7 @@ fn decode_base64(s: &'static str) -> Result<Vec<u8>, base64::DecodeError> {
pub fn serve(archive: &'static str) -> Server {
// TODO cache!
// "Soni" base64-decodes to 0x4a 0x89 0xe2
- let server = Arc::new(Httpd::http("127.74.137.226:0").unwrap());
+ let server = Arc::new(Httpd::http((IP, 0u16)).unwrap());
let sv = server.clone();
std::thread::spawn(move || {
let archive = Cursor::new(archive);