Giter Club home page Giter Club logo

frostwire-jlibtorrent's Introduction

frostwire-jlibtorrent

JLibtorrent Logo

A swig Java interface for libtorrent by the makers of FrostWire.

Develop libtorrent based apps with the joy of coding in Java.

Using

Download the latest JAR or get the dependency via Maven:

<dependency>
  <groupId>com.frostwire</groupId>
  <artifactId>jlibtorrent</artifactId>
  <version>1.1.0.36</version>
</dependency>

or Gradle:

compile 'com.frostwire:jlibtorrent:1.1.0.36'

Note that there are multiple version of jlibtorrent for different platforms: jlibtorrent, jlibtorrent-windows, jlibtorrent-linux, jlibtorrent-macosx and jlibtorrent-android-<arch>. These are all different artifacts.

For examples look at https://github.com/frostwire/frostwire-jlibtorrent/tree/master/src/test/java/com/frostwire/jlibtorrent/demo

Architectures supported:

  • Android (armeabi-v7a, arm64-v8a)
  • Linux (x86, x86_64, armhf, arm64)
  • Windows (x86, x86_64)
  • Mac OS X (x86_64)

Building

You need:

  • Setup a travis account at http://travis-ci.org and get familiar with the service if necessary.
  • Open an account with Amazon Web Services (AWS) and get familiar with S3 (for storage) and IAM (for users).
  • Some familiarity with git commands.

The process is:

  • Create a user in amazon IAM, let's suppose it is user1. Download credentials for the keys.
  • Create a bucket in amazon S3, let's suppose it is jlibtorrent1.
  • Set the permission of the bucket according to your workflow, but at least the user1 should have permission to put/upload to the bucket. See for example this bucket policy:
{
	"Statement": [
		{
			"Effect": "Allow",
			"Principal": {"AWS":"arn:aws:iam::<find your id here>:user/user1"},
			"Action": "s3:PutObject",
			"Resource": "arn:aws:s3:::jlibtorrent1/*"
		},
		{
			"Effect": "Allow",
			"Principal": "*",
			"Action": "s3:GetObject",
			"Resource": "arn:aws:s3:::jlibtorrent1/*"
		}
	]
}
  • Fork the project in github.
  • Go to travis an enable the repository.
  • Go to the settings of the repository and add these variables S3_ACCESS_KEY, S3_SECRET_KEY, S3_BUCKET using the values of the credentials and the bucket name.
  • Clone locally your repo, let's assume to the jlibtorrent folder and checkout the stable branch:
$ git clone <your fork repo url> jlibtorrent
$ cd jlibtorrent
$ git checkout libtorrent-RC_1_1
  • Create a new branch with the name travis-build:
$ git checkout -b travis-build
$ git push --set-upstream origin travis-build
  • Verify in your travis online if the build already started. The build could take about 40 minutes, be patient.
  • When finished, check your s3 bucket for the binaries.
  • To trigger a new build, just make a change or merge new changes from the stable branch, commit and push.

NodeJs JLibTorrent Module (alpha)

We have recently added support for a NodeJS binary module so you can now have all the power of libtorrent in Javascript/Node.

Help Wanted: At the moment we can only do simple things, like creating torrents and opening torrents, but nothing related to an actual torrenting session is still available, we need to figure out how to add a thread to process libtorrent alerts and then invoke the necessary callbacks for these alerts.

For now it builds, it can be imported in node and you can do simple things.

MBP:swig aldenml$ node
> var jlib = require("./build/Release/jlibtorrent");
undefined
> var s = new jlib.session()
undefined
> var ti = new jlib.torrent_info("/Users/aldenml/Downloads/Lisa_Richards_Beating_of_the_Sun_FrostWire_MP3_Nov_09_2015.torrent");
undefined
> ti
torrent_info {}
> ti.name()
'Lisa_Richards_Beating_of_the_Sun_FrostWire_MP3_Nov_09_2015'
>

Here is an example of how to create a simple .torrent using the low level libtorrent API already available in Javascript/Node.

If you want to build the NodeJS module, you will need to install node-gyp

npm install -g node-gyp

then from the swig/ folder you can build the NodeJS jlibtorrent module with

node-gyp build

after the build is done, you can test by going to the swig/build/Release folder and issuing:

$ node -e "var jlibtorrent = require('./jlibtorrent'); console.log(jlibtorrent.LIBTORRENT_VERSION);"
1.1.0.0

Contributions are rewarded instantly with our Bitcoin donations fund

tip for next commit

License

This software is offered under the MIT License, available here.

frostwire-jlibtorrent's People

Contributors

aldenml avatar benhc123 avatar burnbeforereading avatar dessalines avatar frostwire avatar gubatron avatar humzini avatar jbafford avatar proninyaroslav avatar tchoulihan avatar

Watchers

 avatar  avatar  avatar

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.