Is it possible to host telegram on my own server? - telegram

Telegram is a cloud based chat service. All of their clients are open source. I was wondering if there's a way to host a 'private' telegram service on my own server.
If not, is there anything out there that can provide all or almost all features that telegram provides?

According to the official telegram FAQ the current answer is no:
Q: Can I run Telegram using my own server?
Our architecture does not support federation yet. Telegram is a unified cloud service, so creating forks where two users might end up on two different Telegram clouds is unacceptable. To enable you to run your own Telegram server while retaining both speed and security is a task in itself. At the moment, we are undecided on whether or not Telegram should go in this direction.
So as long as the server itself is not open-source the entire Telegram eco-system cannot be considered open-source, even though there is an open API and official open-source clients.
There seem to be some unofficial telegram servers, but it's not clear how compatible they are with existing clients.
Some possible telegram alternatives
Matrix is allegedly providing "an open network for secure, decentralized communication" and has both open-source clients (Element being the 'official' one) and an open-source server that can be self-hosted. BUT while it looks good on the surface, there are indications that companies behind it have undisclosed intimate links with governmental actors (similar to Signal).
XMPP/Jabber has been around for a longer time, is an open protocol with multiple server and client implementations, and might be the least tainted by third-party interests. XMPP was the underlying protocol behind the original Google Talk messenger before it was rebranded to Google Hangouts and switched to a proprietary protocol.
Teamspeak a collaborative platform for teams, intended originally for gamers, free client and server.
Mumble a voice oriented solution which allows self-hosted servers.

You could implement a full working Telegram-API, then have hosted clients on your server via this API.
Your users would login on your web, then you sign them in via the hosted clients on your servers.
You are basically performing a proxy service to these users , and you can even integrate other value added features for you users this way.

Related

Can a http client using XMPP interact directly with jitsi videobrigdge server?

I want to implement a cross platform chat app. I want to use XMPP and I know that XMPP's BOSH extension is used for instant messaging.
However, I also need a video conference and audio conference abilities. jitsi does that actually. It uses prosody for instant messaging which actually uses BOSH. And jitsi uses jitsi-videobridge(which can be found in the same link I attached previously) for audio and video conference capabilities.
Here comes my question. Can an http client using XMPP protocol can talk to a jitsi videobridge server directly without needing any other requirements. I'm confused because in the official website of jitsi, it is written that it is compatible with WEBRTC. I really couldn't grasp the idea of WEBRTC. Does WEBRTC compatible mean that http client can talk to server without any other needs or XMPP protocol is the same basis for both?
Any help or corrections appriciated.

How do I use a server hosting a web application to set two users up to communicate with each other without a server?

I want two users of my web application to agree to communicate with each other, and then my server would no longer be relied on for the communication. What are my options to have two computers communicate over the internet without relying on my server? How would I set this up--specifically, what API or protocol could I use?
I want to allow the users to run various secure computations, and I don't want my server to act as a trusted third party.
This previous question discusses the problem, but the answer is very vague. I know very little about doing web anything, and I'm having trouble finding where to look. Someone pointed me to the xmlhttprequest API, but I don't see how that is helpful.
It is possible with pretty new WebRTC technology. You should look at
data channels between clients. RTCDataChannel API provides secure (DTLS based) peer-to-peer communication. Not all browsers have support of the WebRTC and among them not all supports RTCDataChannel API. So beware browser compatibility problems.

Is it possible to push data from the server to the client (phone, computer) without OS integration

is there a way for a server to push some data to a client, wirelessly and seamlessly, which may be Windows(Phone), iPhone, Mac, or Android device, without any OS integration?
If so, what's the best design pattern to do this, and what are the best technologies to go about this?
Push technology is simply a methodology of the server initiating the transfer of data, rather than the client asking the server for it.
Apple makes push technology relatively easy to use by providing such functionality built-in on the OS. As well as Android through the Google Cloud Messaging for Android. Windows, however, does not.
Apple push notifications and Google's messaging for Android is seemingly magical and/or functionality that the OS needs to handle; however, this isn't necessarily the case. The advantage of having it "integrated" in the OS, is the same as having a framework handle the functionality for you.
Speaking in technical terms, push technology is a long-lived connection from the client to the server that accepts messages. These messages would be considered pushed messages, since the client did not make an individual request for them.
The main thing to keep in mind when implementing push technology yourself, is that the client is in charge of keeping that long-lived connection alive as much as possible. Because client IP addresses can change between disconnects, servers are not guaranteed that a client's address will be persistent across disconnects. Moreover, clients can be connected from behind a firewall, making it impossible for a server to reach the client.
For comparison, pull technology is the more traditional process of a client connecting to a server and requesting data.
Your best bet for Apple iOS will be using their push notification service.
For Android devices you should use the Google Cloud Messaging for Android. Alternatively, you can create your own background service to handle the messaging; here's a guide.
For Windows (desktop at least), you will have to create your own service to perform such duty. Here's an MSDN guide explaining how to create a Windows Service using Visual Studio (VB and C#). There might be frameworks already built that handle such messaging on Windows, however, I don't know of any.
Use WebSocket (with or without socket.io).
In the future, you could use WebRTC.
With Websockets, the setup is really simple. The client (a user agent, like a browser or a WebView) connects to the Websocket server, over http(s) (less problems with firewalls) and that's it. There's a bidirectional socket with an event-based API.
If by "OS integration" you mean "write special code for each platform" then the answer is no.
As you mentioned, you would like file system access, and background processing. That combination is not available in a cross-platform way at this moment.
If by "OS integration" you meant "without having to wait for apple/google/ms to provide the ability" then the answer is yes/maybe.
All the popular platforms have Push notifications and background processing support, as long as you code it the way each particular platform expects it.
But file system access will be limited to what restrictions the platform places on you. For instance in ios and win8(phone) there is no wy to write or read a file outside of your own apps private file structure. For security reasons, you cannot access the file system of other apps.
UPDATE:
The general pattern here is to release an app for every platform you want to support.
The app will register itself with its respective platform's push notification service.
You will write generic server side code to accept the data you want to push to all your client devices. Then you will invoke the respective push API's for each platform you support, causing the client devices to wake up and trigger the app that you provided to respond.
When the app opens, you get the app to contact your server and download the full data "the push notification being just the wakeup call for your app"
This way you can easily tell how which of your devices have received the data.
Each platform specific app must save the data to its own local storage and provide a way for the data to be shared via the methods supported by its respective platform.
On IOS it can be as simple as supporting the "Open In.." paradigm.
On W8Phone, you'll have to publish the data via one of the available "sharing contracts"
And so forth for every platform you want to support.
This is the general pattern at the moment. There are some caveats. On IOS, the app will nt automatically start when a push notification is received. This means your app will only download the whole of the data when the app is opened by the user.
A mobile app also cannot generally run indefinitely in the background. This means that once the app is started, you have a limited window for push notifications to be automatically processed by your app. After the allowed "background time". The app will close and any push notifications beep on the device, but wont open the app until the user taps on one of the notifications or opens the app directly.
Technically you could use XMPP Libraries, it is meant for implementing chat system (msn, gtalk, facebook chat, etc...) but this could work well as a push message system because it is opensource and well built to handle all the cases you never thought of. Also you could host your own server and send push message that way...
Why not use a webservice? In my previous project I used webservice to deliver data from mysql database. The webservice I used was nusoap. On the client side I used kSoap library for Android. Hope this helps.
if you want to receive and send real time communication between a server and client (irrespective of the device or OS), i would highly recommend you use XMPP technology because it is designed for the sort of things you're asking for.
The Extensible Messaging and Presence Protocol (XMPP) is an application profile of the Extensible Markup Language [XML] that enables the near-real-time exchange of structured yet extensible data between any two or more network entities. The core features of XMPP defined in [XMPP‑CORE] provide the building blocks for many types of near-real-time applications, which can be layered on top of the core by sending application-specific data qualified by particular XML namespaces.
http://xmpp.org/rfcs/rfc6121.html#intro - that is the latest RFC which will give you a good starting point.

steps to setting up jabber

Ok I tried going to jabbers site, and it looks like cisco has acquired them.
Is jabber a server or a client? is it open source?
From what I guess, the steps are:
install the jabber server on your server
for a web application, creating a interface that will insert/select messages from the jabber server. I'm guessing communication will be in some xml format?
Jabber is the same thing as XMPP. The canonical place to find out about jabber is www.xmpp.org. They host all the documentation about the protocol. If you just want to use it, jabber.org hosts a free jabber server you can connect to, and is a great place to try it out. Psi (psi-im.org) is a good free client to try out the system.
The jabber protocol is a bit like smtp for instant messaging (IM). Servers federate (talk to each other) and the protocol is plain text, and defined in several RFCs. There are both client and server pieces of the protocol.
As you discovered, jabber.com (Jabber, Inc) was purchsed by Cisco. Jabber, Inc sold a proprietary jabber server (XCP) with great scalability that used the defined RFC protocols. There are several other servers out there, some free, some not. They all can communicate, which is the cool thing. Or not communicate, which is also cool.
I recommend trying out jabber clients, finding an active chat room (called MUC, multi user chat) and see where that takes you. If you're a developer you can use XMPP for any presence enabled thing. It's very extensible.
Oh, if you've used gtalk, you've used jabber. It's popular, open, and not tied to any one particular company.

Good asynchronous TCP based protocol for non-realtime games?

I'm developing open source cross-platform platform for non-realtime multiplayer chat/game system. Like card games, boardgames, turn-based, etc. Servers are spawned server-side (not from users computer). Client has these game modules or downloads game module and then runs them.
I've come to conclusion that best protocol is "IRC-like". So that there is channels for chats and games.
For example there's channels
Lobby
Lobby.English
Lobby.Finnish
Lobby.Mygame - chat for one particular game
Lobby.Mygame.English
Game.Server.Announcements - When new server is created server shouts it here. All clients are listening to this. You can get list of all game servers running.
Game.3636534.chat - Spesific game chat
Game.3636534.game - Users send commands like Buy X here and server responds to them
Some stuff i've looked into
XMLRPC is no good because you have to poll for new data every few seconds
ICE - Pretty good but should be a bit more RPC friendly
ActiveMQ/RabbitMQ and it's publisher/consumer system is something i'm looking for. Problem is that good user ACL is missing. So basically everyone can "go" everywhere and send any garbage to the main AMQ server.
The supported programming languages for this should be at least C#, Java and Python. Encrypting support should be also there. And of course free.
You should look into XMPP which is an open standard for asynchronous message passing. It has support for encryption, firewall traversal and much else. Servers and libraries are available for many, many platforms including the ones you mention.
Links to implementations and information: http://xmpp.org/

Resources