Why does tracker server NOT understand my request? (Bittorrent protocol) - c

I'm trying to implement Bittorent in C. First of all, before writing a code snippet, I tried to used a web browser to send the following message(URL) to the tracker server.
you may try this URL.
http://torrent.ubuntu.com:6969/announce?
info_hash=%9b%db%bbI%f0%85%a2%d1%5d%96%ac%fa%bf%f81%06%001O%e0
&peer_id=ABCDABCDABCDABCDABCD&port=6882&downloaded=0
&uploaded=0
&left=0
&event=started
I have downloaded the torrent file from this link which is named dapper-dvd-i386.iso and has 9bdbbb49f085a2d15d96acfabff8310600314fe0 as SHA-1 value.
However, after sending above request, I get
your client is outdated, please upgrade
(HTTP 400 bad request)
Why does tracker server NOT understand my reqeust? Any specs from Internet does not help me.
Any help would be awesome. Thank you in advance.

It is because the request string don't have compact=1 in it.
Most tracker require that nowadays. The legacy way is too ineffective.
See BEP 23: Tracker Returns Compact Peer Lists http://www.bittorrent.org/beps/bep_0023.html
Try:
http://torrent.ubuntu.com:6969/announce?
info_hash=%9b%db%bbI%f0%85%a2%d1%5d%96%ac%fa%bf%f81%06%001O%e0
&peer_id=ABCDABCDABCDABCDABCD&port=6882&downloaded=0
&uploaded=0
&left=0
&event=started
&compact=1
ie
http://torrent.ubuntu.com:6969/announce?info_hash=%9b%db%bbI%f0%85%a2%d1%5d%96%ac%fa%bf%f81%06%001O%e0&peer_id=ABCDABCDABCDABCDABCD&port=6882&downloaded=0&uploaded=0&left=0&event=started&compact=1
and the answer from the tracker is:
d8:completei4e10:incompletei0e8:intervali1800e5:peers6:******e

Related

Trying to implement in-app voice call from browser

I have cloned the click-to-call repository and followed the steps as mentioned. I am able to login with said created user but then get stuck at /rtc API.I got some error in network panel. and "General SSL engine problem in console which is not correct. SSL certificates are all correct." Let me know where i went wrong. Please check the screenshot below :
I have had a talk with nexmo team, they said it is the ssl issue.
https://help.nexmo.com/hc/en-us/articles/207051767-Certificate-for-nexmo-com
Now I am unable to find where to import the certificate to my app?
I am the JavaScript Developer Advocate at Vonage (Nexmo).
You also filed an issue at https://github.com/nexmo-community/client-sdk-click-to-call correct? Thanks for that. I will also post my response here.
From your issue, it looks as if the Conversation Id is not being sent.
We recently merged some changes to the repo.
In your .env file, do you have SUPPORT_PHONE_NUMBER? That should be NEXMO_NUMBER.
Also, when calling the server, previously the code in the client.js around line 34 was application.callServer(); it is now application.callServer(application.me.name);
Let me know if this works for you.
Check with Nexmo - either you are out of balance or your account has been been marked inactive for some reason. Most of the time its because of insufficient balance.

Sending email with camel

I'm having issues sending an email out through camel with the java dsl.
I've been using the camel mail guide but I receive the following error.
Caused by: [com.sun.mail.util.MailConnectException - Couldn't connect to host, port: smtp.google.com, 25; timeout 30000]
Here is what I have in my route
from("timer://foo?period=5000") // Create a message every 5 seconds
.setHeader("subject", simple("hello from camel"))
.setBody(simple("camel"))
.log("sending?")
.to("smtps://smtp.google.com?password=mypass123&username=user#custom.com&From=user#custom.com&To=testuser#gmx.com");
The email service is actually provided by gmail. Now I did see a gmail plugin, but its pretty tough to find an example, so I thought I would use the standard method for now. But if someone knows the solution using it, I welcome it!
PS. I have camel-mail dependency and thecamel-google-mail which I'm not using.
Versions 2.20.2
It was due to less secure apps not fully being turned off.
Use this link here https://www.google.com/settings/security/lesssecureapps
Also some of the silly mistakes pointed out in the comments.
Thanks!

Java IOException during API request to Stripe (APIConnectionException)

The specific action we are trying to performe is to create a charge request with Stripe:
Charge charge = Charge.create(params);
Using Stripe's Java implementation (version 5.35.1) we encounter a APIConnectionException when running the application on the deployed App Engine server. Interestingly, the issue does not occur using App Engine's local dev server.
We contacted Stripe and they said everything is fine on their side. They explained that "this error indicates that your server is not able to contact our API and that it ends up timing out waiting for an answer. Usually, this is due to something misconfigured on your server such as a DNS not redirecting to Stripe properly."
We were wondering if there are some configuration settings on App Engine which cause the problem. However, since there is no specific error message we cound not figure out what might cause the connection problem.
Similar problems which did not provide enough help to resolve this issue: https://issuetracker.google.com/35901039
Thanks for your help!
The problem seems to have solved itself. It occured for a couple of days and since a few hours the exact same code is working fine. Just like in https://issuetracker.google.com/issues/35901039 the problem is suddenly gone for some reason.

Self hosted SignalR client method not invoked

I know this issue has been treated before since I have googled and read most of the responses of people who have had the same or similar problem in the past. None of them have been the solution for my case. The problem I have is my client method is not getting called and I have already defined the client method before starting the hub. When I do that I get another error but when I define the method after starting my hub, I don't get an error but then my client function does not get fired.
I think, the fact that I am self-hosting in a Win service using static files serving or because I am using AngularJS, that's why I am having this problem. but I am not really sure.
Can you help me? Any suggestions? Of course I have gone through the SignalR troubleshooting guide several times. I have checked the name of my client method to make sure all is correctly named but still this problems rears it head. I would like to believe the fact that its because I am self hosting or because of Angular . I know that when I define my client method before starting the hub, the hub tries to setup subscriptions to the signal service and when it tries to do so fails because it cannot find (my assumption) the hub which is defined (Hub name: OffiHub) in a folder (/OffiSignalR/Hubs).
I get the following error when I debug using Chrome: jquery-2.2.1.js:9175 GET http://localhost:36900/OffiG/start?transport=serverSentEvents&clientPD%3D&connectionData=%5B%7B%22name%22%3A%22offihub%22%7D%5D&_=1459195567970 500 (Internal Server Error)
In case you wish to see my code, here it is:
var offiHub = $.connection.offiHub;
offiHub.client.publishSales = function (so) {
//Add to the current list.
console.log("We got here!");
log('We got here, hurray!.');
};
$.connection.hub.start().done(init);
I have found the answer to my problem. It was all my fault, I had a code snippet in the OnConnected method on the server which was failing when I try to connect to the service from the client. I had placed the code there for when I would need it but hadn't thought much about it. This code has given me much grief these past few days. Remove it and all is working well from all clients. In fact it was the .Net client that made me suspect the faulty code.

How can a server communiate with two clients at once (JavaScript, HTML, PHP)?

I got an assignment to do and for that I could use any www technology like HTML, JavaScript, PHP etc. I'm really sorry to say that I haven't studied any of these technologies. Therefore I took few tutorials and skimmed through them searching for answers.
I found solutions for many problems but one problem yet unsolved. It is this:
I want two clients to communicate through a server for this assignment. One send a message, server processes it and forwards it to the next.
None of PHP tutorials showed me anyway of doing this. All of them talked of communication between one client with a server.
Please help. Show me a way to do this. Thanks.
Currently, without reverting to cutting-edge (and possibly hacky/unreliable) techniques, your PHP server cannot initiate communications with a page you've already loaded into a web browser. This is a result of the way the HTTP protocol works.
One way to solve this would be polling on the "receiving" end for data. Something like a publish-subscribe pattern.
One way to do this would be:
One client sends data to the server using an HTTP request (XHR aka AJAX) specifying the target for this data (the other client).
The server stores this data in a persistent storage (local file, database, etc).
The second client periodically sends a request to the server asking if there's any new data for it to consume. This can be done using setInterval and XHR in JavaScript.
I would suggest you take a look at:
http://en.wikipedia.org/wiki/Publish/subscribe
And also, for a cutting edge way to do this, check out Socket.IO:
http://socket.io
You might want to Google on "php chat server." Building a chat server is a simple way to get started.
http://net.tutsplus.com/tutorials/javascript-ajax/how-to-create-a-simple-web-based-chat-application/
http://code.jenseng.com/jenChat/

Resources