Giter VIP home page Giter VIP logo

ifconfig.top's Introduction

ifconfig.top

A simple web application written in Rust to show visitor's ip address.

Demo: https://ifconfig.top.

Run it

Clone the source code and run it

$ git clone https://github.com/ngoduykhanh/ifconfig.top.git
$ cd ifconfig.top
$ cargo run

Visit the app at http://127.0.0.1:5000

Note: set PROXY_MODE=true if you deploy the app behind a proxy

License

MIT

ifconfig.top's People

Contributors

ngoduykhanh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ifconfig.top's Issues

Enhance readability

Please help to add newline character "\n" in response.

diff --git a/src/main.rs b/src/main.rs
index ca1310b..b20c634 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -94,7 +94,7 @@ fn index(req: HttpRequest<AppState>,
     // If user browses the index page by using command line,
     // return the public ip address instead of whole html page.
     if is_cli(&req) {
-        return Ok(HttpResponse::Ok().content_type("text/html").body(ip_address))
+        return Ok(HttpResponse::Ok().content_type("text/html").body(ip_address + "\n"))
     }
 
     let default_cmd = String::from("curl");

CORS Issue

Hi, I assume that this URL is accessible to the public. However, we're encountering a CORS error. Could you please add our domain to the whitelist?

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ifconfig.top/all.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.