Git Product home page Git Product logo

Comments (6)

SeedDMS avatar SeedDMS commented on May 27, 2024

+1

My idea was to implement a plugin for a document management systems which contacts a croc relay to retrieve a file. Is there any documentation on how to talk to the relay?

from croc.

schollz avatar schollz commented on May 27, 2024

check cli.go to see how to use croc as an API: https://github.com/schollz/croc/blob/v9.6.15/src/cli/cli.go

from croc.

SeedDMS avatar SeedDMS commented on May 27, 2024

I was actually hoping for something the describes the protocol between client and relay, because I do not intend to use go but php to access the relay.

from croc.

schollz avatar schollz commented on May 27, 2024

you don't need to use Go. but that file describes the protocol in Go code

from croc.

SeedDMS avatar SeedDMS commented on May 27, 2024

It's still difficult to collect the parts together. Most of the protocol code appears to be in https://github.com/schollz/croc/blob/v9.6.15/src/croc/croc.go but I'm still missing the overall picture for receiving a file which has been send to a relay.

from croc.

schollz avatar schollz commented on May 27, 2024

I'm still missing the overall picture for receiving a file which has been send to a relay

here's the overall picture on how receiving a file with croc works:

  1. when you run croc receive <code>, croc starts by connecting to the relay server using the provided code.

  2. the relay server helps both the sender and receiver establish a connection, even if they are behind different network setups like nat or firewalls.

  3. once connected through the relay, croc sets up an encrypted channel using the same code to ensure the transfer is secure.

  4. croc attempts to switch to a direct peer-to-peer connection for better speed. if that's not possible, it continues using the relay. the file transfer begins, and you will see progress updates in your terminal.

  5. after the file is fully transferred, croc verifies the integrity of the received file to make sure everything is correct.

you can find the main logic for handling this process in croc.go, but it also interacts with several other parts of the codebase for encryption, connection handling, and progress reporting.

from croc.

Related Issues (20)

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.