CaliDog / certstream-java

Java library for connecting to the CertStream network.
MIT License
16 stars 15 forks source link

Stream ends after 1 min #4

Closed Tim269 closed 4 years ago

Tim269 commented 4 years ago

Hey there! I really love this project and the possibilities it does offer. Sadly recently it did somehow break. When I use the following as a test code:

public static void main(String[] args){
        CertStream.onMessageString(msg -> {
            JSONArray jsonArray =  new JSONObject(msg).getJSONObject("data").getJSONObject("leaf_cert").getJSONArray("all_domains");
            for(Object domain : jsonArray) {
                System.out.println(domain.toString());                  
            }
        });     
}

The stream / program does just stop after about 1 minute or 7k - 8k domains.

Is there something I do wrong? Or did something else change? Thank you!

Tim269 commented 4 years ago

Ah Sorry. I found the answer on the other projects. As temp fix I'll run a cron every minute.

joshbooks commented 4 years ago

@Schneidertm I didn’t know about this limit (I assume @Fitblip put something in place?) could you link me to where you found this answer?

Tim269 commented 4 years ago

Correct. Oh yeah sorry I forgot to link them, here they are:

https://github.com/CaliDog/certstream-python/issues/27 https://github.com/CaliDog/certstream-go/issues/8

and https://github.com/ninenines/cowboy/issues/1259

Fitblip commented 4 years ago

Just to close the loop here, we need to send an occasional ping from the clients to ensure the server doesn't assume they're dead. I originally just had the timeout set to something really high but that (understandably) causes issues on the public server.