hexchat | xmpp tunnel protocol | TCP library
kandi X-RAY | hexchat Summary
kandi X-RAY | hexchat Summary
when using hexchat, the data is sent to a local tcp socket running hexchat (call it hexchat1). hexchat1 then reads the data (thereby stripping it of its tcp header) and passes it over a chat server to another hexchat program (call it hexchat2) that sends the data to the appropriate ip:port (giving it a new tcp header in the process). the client thinks it is sending the data to hexchat1, and the server thinks it is receiving data from hexchat2, but the data itself is never changed. it might be broken into smaller chunks or combined into bigger chunks, and it might be delivered at unpredictable rates, but it is never altered. summary of implementation: when the program is started, it is told what jid(s) to use to connect to a chat server, and possibly the following optional parameters: 1. an ip:port to listen on. when a connection is made, the server and client exchange all jids they are using to connect to the chat server so they can each rotate through jids to send messages from and jids to send messages to. with the exception of initial connections, all messages are sent as
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Called when a packet is received from the client
- Delete an existing socket
- Convert an IP address to a key
- Read messages from the connection
- Buffer a message
- Close the connection
- Return the name of the to_alias
- Get a message from the client
- Wrapper for sendMessageWrapper
- Handles disconnections
- Send a Connectack packet
- Handle a disconnect error message
- Check the data buffer for the specified key
- Handle incoming connection messages
- Handle a connection
- Handle a new connection request
- Send a disconnect_error request
- Create a server socket
- Add a server socket
- Called when the client is disconnected
- Perform a select loop
- Called when an error occurs
- Get message from client
- The main loop for accepting connections
- Called when a data packet is received
- Handle an incoming connection
hexchat Key Features
hexchat Examples and Code Snippets
Community Discussions
Trending Discussions on hexchat
QUESTION
This seems to be a fairly common pattern e.g. in hexchat (may not compile, see also plugin docs. also note that hexchat_plugin_get_info
hasn't been used in forever so I'm omitting it for simplicity):
ANSWER
Answered 2018-Oct-03 at 14:46Using a value of a pointer after the object it is pointing to have reached it's lifetime end is indeterminate as stated in the C11 Standard draft 6.2.4p2 (Storage durations of objects) (the emphasis is mine):
The lifetime of an object is the portion of program execution during which storage is guaranteed to be reserved for it. An object exists, has a constant address, and retains its last-stored value throughout its lifetime. If an object is referred to outside of its lifetime, the behavior is undefined. The value of a pointer becomes indeterminate when the object it points to (or just past) reaches the end of its lifetime.
And using it's value (just for anything) is an explicit undefined behavior as stated in Annex J.2(Undefined behavior):
The behavior is undefined in the following circumstances: [...] The value of a pointer to an object whose lifetime has ended is used (6.2.4).
QUESTION
The only other question I can find about terminating Python timer threads is this one: how to terminate a timer thread in python but that only tells me what I already knew from reading the threading documentation.
I am writing a GTK app in Python. It is interfacing with HexChat via d-bus. Because there is no D-bus signal when a user changes context (switches to a different IRC channel or server window) my original design waited until the user interacted with the GUI in some way to see what context we are currently in. The downside to this is entry boxes which need to be switched out can't really be used to switch contexts, because if a user starts typing, the changed signal is issued and the contents get saved to the old context, which is incorrect behaviour.
To solve this, I decided to use a threaded timer task to check what the current context is every 0.5 seconds. The thread function checks the current context, updates a variable in the class, and then re-starts itself with another 0.5 second delay. This works perfectly and is fast enough that it will keep up with users switching channels often.
However, even when I add a TimerThread.cancel to my __del__()
function, instead of my program exiting it just hangs until I give a keyboard interrupt. I also tried doing a TimerThread.cancel, sleep(0.1), TimerThread.cancel again just in case I happened to cancel the timer as it was in the context-checking function. Same result. I also tried putting the TimerThread.cancel in the onDestroy function (which will in turn call the __del__
destructor) but no change. The GTK loop exits, and the GUI disappears, but the program just hangs in the console until keyboard interrupt. When I do give a keyboard interrupt, I get a traceback error from the threading library.
Is there some other way to terminate the thread? Is there some other step I need to take to kill the threading library before exiting? Am I misunderstanding how Timer threads work?
Here are the relevant sections of the code: https://paste.ubuntu.com/p/kQVfF78H5R/
EDIT: Here is the traceback, if that helps.
...ANSWER
Answered 2019-Aug-13 at 08:50I think you're running into a race condition. Try to protect the contextUpdater
variable with a lock. Here, I added three new functions, namely start_updater
which is called from the class __init__
method, stop_updater
, and restart_updater
which is called from the getContextTimer
method. Before exiting your application, call stop_updater
method which will cancel the currently running timer (don't call it from __del__
method):
QUESTION
When attempting to connect to a socket configured with SSL and the WebSocket Hook the connection fails.
JavaScript WebSocket Request:
...ANSWER
Answered 2017-Jul-12 at 16:50You have to accept Self-Signing cert on https://ohmingle.com:7001 first and you can connect via wss.
QUESTION
I have a list of dictionaries in python as follows:
...ANSWER
Answered 2019-Mar-23 at 19:06Use a set
to keep track of all (category, name)
pairs you've already seen:
QUESTION
I've coded a non-evil, non-spammy IRC bot in PHP, using fsockopen
and related functions. It works. However, the problem is that I need to support proxies (preferably SOCKS5, but HTTP is also OK if that is somehow easier, which I doubt). This is not supported by fsockopen
.
I've gone through all search results for "PHP fsockopen proxy" and related queries. I know of all the things that don't work, so please don't link to one of them.
The PHP manual page for fsockopen mentions the function stream_socket_client()
as
similar but provides a richer set of options, including non-blocking connection and the ability to provide a stream context.
This sounded promising at first, supposedly allowing me to just replace the fsockopen
call with stream_socket_client
and specify a proxy, maybe via a "stream context"... but it doesn't. Or does it? I'm very confused by the manual.
Please note that it must be a PHP code solution; I cannot pay for "Proxifier" or use any other external software to "wrap around" this.
All the things I've tried seem to always result in me getting a bunch of empty output from the server, and then the socket is forcefully closed. Note that the proxy I'm trying with works when I use HexChat (a normal IRC client), with the same network, so it's not the proxies themselves that are at fault.
...ANSWER
Answered 2019-Mar-13 at 21:08As far as I know there is no default option to set a SOCKS or HTTP proxy for fsockopen
or stream_socket_client
(we could create a context and set a proxy in HTTP options, but that doesn't apply to stream_socket_client
). However we can establish a connection manually.
Connecting to HTTP proxies is quite simple:
- The client connects to the proxy server and submits a CONNECT request.
- The server responds 200 if the request is accepted.
- The server then proxies all requests between the client and destination host.
QUESTION
I am using the HexChat client on my local machine. I have been using an unregistered nick, eg. foobar. When my connection has dropped I get a message when I try to reconnect:
foobar is already in use. Retrying with foobar01... foobar01 is already in use. Retrying with foobar02...
This has been like this for weeks. My actual username I am trying to use is not something anyone wold be using so it seems it is locked. Obviously I cannot register the nick because I can't connect with it.
What's the solution?
...ANSWER
Answered 2017-Feb-17 at 21:16If you are saying it is happening only temporarily after disconnecting that is often referred to as a ghost and your old connection just hasn't timed out. If you register the nick you can forcefully disconnect it otherwise you wait.
If it is always happening and another user is actually using it /whois $thenick
then there is nothing you can do about that since you didn't register it.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
Install hexchat
You can use hexchat like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page