jackiszhp / NodeTox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeTox

Make working with c-toxcore low-level api more easy

Mission:

  • Create NodeJs wrapper for c-toxcore api (based on [c-toxcore])
  • Create material web ui for tox client
  • Create cross-platform tox client

What is it?

Addon that provide using toxcore api in Node.js environment.

How to build

Windows build (Visual Studio 17)

  1. Download the
  2. Build toxcore using these instructions
  3. Create new Visual Studio project with master of classic windows application (select app type as static library and remove check mark from precompiled header).
  4. Add this libs as a dependencies: advapi32.lib;iphlpapi.lib;psapi.lib;shell32.lib;ws2_32.lib;libsodium.lib (don't forget specify path of libsodium.lib placed folder. You need to build libsodium.lib from sources additionaly for your platform).
  5. Add exists elements: libsodium.lib, pthreadVC2.lib and toxcore.lib to project and build. Then you get one file *.lib, that contain above libs as one.
  6. Create empty folder and init new npm package:
npm init
npm install node-addon-api
  1. In file binding.gyp specify your own path to the include files and libs
  2. In package root, as administrator, type node-gyp clean configure build --verbose --arch=ia32
  3. Put libsodium.dll and pthreadVC2.dll into root package folder. You must put these files in another projects that uses obtained ToxAddon.
  4. Ok, you would get build folder where lay files ToxAddon.node and ToxAddon.lib. After that you may type node index.js and you would see "connected 2" over time. That works!

How to use

  • Example provides in file index.js
  • You may call tox methods that contains in file toxcore.c.
  • You may install this addon as dependency package to another project.

About


Languages

Language:C++ 97.5%Language:Python 1.3%Language:JavaScript 1.2%