Can't run aiogram on VPS with webhook - telegram

I tried to run aiogram with webhook on digital ocean. And it's not working.
here code from documentation example.
And it has only one change - WEBHOOK_HOST = 'https://207.154.234.52'
full example https://docs.aiogram.dev/en/latest/quick_start.html
Everything else is the same.
It works with ngrok.
What is the problem here?
(I tried a lot of different ports)
By the way, one more question,
line from telegram docs - "on port 443, 80, 88, or 8443."
but why it works with ngrok on every port?
Tried to run it with ngrok, and local.

Related

Connecting Arduino SocketIoClient to NextJs api route

I have a nextJs socket server in pages/api/socket hosted locally and my code is the same as what this article talks about.
My Arduino code is working in ESP8266 like this example from github
Basically, I emit a message event every 500 milliseconds from the Arduino loop and I want to console log that message when received by the nextJs api route but it does not worked for me.
I don't know the exact problem here, but when I tried this, a server using nodeJs and express and socket.io, it does work.
I am thinking that the problem is, in Arduino SocketIoClient, the websocket.begin("192.168.1.4", 3000) will connect to my http://localhost:3000 but my nextJs socket server lives in /api/socket so I added the url as the third parameter that looks like this, websocket.begin("192.168.1.4", 3000, "/api/socket"). But this does not work. NextJs cannot receive the connection from the Arduino.
Can anybody help or explain what is going on here?

How to monitor video and https traffic using bro network security monitor

I have configured bro on my system successfully. OS is centos 7. I have to monotor multimedia traffic e.g. youtube and some social site like facebook. I started bro for some miniutes while using facebook and youtube but their is no information about youtube in http log file nithir facebook. As for I think that this is a protocol problem as facebook use https rather than http but I do not know why youtube.
I have followed following steps after setting correct interface.
[BroControl] > install
Then
[BroControl] > start
But I have not found any youtube or facebook info in http.log. How to get traffic info of such websites?
The problem is that you are expecting SSL encrypted traffic to be magically decrypted and appear in your http.log. If you look again, you will find that YouTube also runs over HTTPS.
Unless you are doing something to intercept and act as a man-in-the-middle for the SSL/TLS connections, you cannot expect to be able to see the content. If you can't see it, Bro can't see it either. :)
If you want to verify that you are properly configured, you would be best served looking at the conn.log to verify that the connections are occurring. Once you do that, search for the UID values in the other logs and I strongly suspect that you will see that you are finding SSL certificate data.
Several things come to mind
1) What are the contents of /usr/local/bro/etc/node.cfg? Make sure it is the interface you expect traffic to cross via a span or tap.
2) Run tcpdump -i <interface> where interface comes from question 1.
3) Run /usr/local/bro/bin/broctl diag to see if there are any issues.
4) Run /usr/local/bro/bin/broctl status to verify everything is running.
If the interface is wrong, the solution may be that easy.

"iot_tls_connect L#143 TCP Connection Error" using basic AWS example with Raspberry Pi

I am very new to aws IOT. I am getting the error:
iot_tls_connect L#143 TCP Connection Error.
I am trying to use the sample aws c code. I have replaced the header config with the config for my account. but none of the sample example go beyond this error. I am using Raspberry Pi.
Sounds like you have the correct certs/keys in place. Make sure the host name is just .iot.us-west-2.amazonaws.com and not https://A<...>.iot.us-west-2.amazonaws.com if you copy-paste it from the console.

When to reload sip

I have faced this issue many times, when I call on my sip line the server responds that the line is busy, though no call is going on when I see with asterisk -vvvr command. When I reload it, it starts working.
Is there a way to troubleshoot this problem or at least get a trigger form some command that sip needs to be reloaded.
Thanks in Advance
Asterisk work for years without reload.
Try update it to latest system or find bug in your config(like no dns, nat settings changed, bad router etc).
Asterisk have no any triggers for such case. You can use external monitoring system(like nagios) which will check sip channel and reload if needed. But better find issue and fix it.
Watch the CLI with a high debug/verbosity to see what's going wrong.
Set verbosity to a high value:
core set verbose 10
Set Debug to a high value:
core set debug 10
You can also check the status of the SIP endpoint with:
sip show peer <extension> (Replace with the number you'd use to dial the endpoint).
If you add verbose CLI output and the output of sip show peer to your question we'll be able to tell you how to fix the issue. Use pastebin or a similar site if the output is very long.

Mininet with ONOS: ARP works fine, Ping wont start

I build a custom mininet topology: 2 hosts with 2 switches between them:
Host1====Switch1====Switch2====Host2
After filling the flowtables with ONOS, the setup works fine. But I have trouble with handling packets that are forwarded to the SDN-Controller.
As controller I use my own onos-app.
I tried some pinging and sniffed the interfaces with tcpdump.
When one host pings the other host, the host sends an arp request. This request reaches the other host and it replies. Even the reply reaches correct the ping-host. But then... Nothing happens.
I would expect the first host to send the ping after he had received the correct arp reply. But instead it does absolutely nothing.
This even doesn't work using only one switch.
Why does the ping itself doesn't start?
Have you any idea what I did wrong?
Thank you.
R you using ONOS or RYU? It seems like you are using RYU.
If you are RYU: Do you have controller setup properly. Run the RYU using the provided controller code like simple_switch_13.py. See if that works.
If you are ONOS, have you installed features? Based on this tutorial you shuld install a feature. something like:
onos> feature:install onos-app-fwd
I don't know how you are programming the switches but for both controllers note that you should add flows for both directions.
Also, sometimes the flows have a very short lifetime that by the time packets arrive they are expired.
If none of these helped, could you provide more details.
OK. Problem solved :-D
This is what went wrong:
The onos-core itself places the default rules for ARP, IPv4 and IPv6, that redirect packets to the controller. Even if the onos-core writes such a default rule to the flowtable of the switch , it doesnt mean that all packets reach your app. In my case only the ARP-packets reached my app, not the IPv4-packets. Therefor I must add 3 lines to the "#Activate"-section of my app.
#Activate
public void activate() {
appId = coreService.registerApplication("org.onosproject.ifwd");
packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 2);
//***ADD THESE 3 LINES*********************************************************
TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
selector.matchEthType(Ethernet.TYPE_IPV4);
packetService.requestPackets(selector.build(), PacketPriority.REACTIVE, appId);
//*****************************************************************************
}

Resources