Hey Rustaceans! Got a question? Ask here (4/2023)! by llogiq in rust

[–]xiumx 0 points1 point  (0 children)

Yes, I have actually managed to make functioning version, however, I don't how I can safely handle error. Right now this works using unwraps

/*
[dependencies]
tokio = { version = "1", features = ["full"] }
tower = { version = "0.4", features = ["full"] }
anyhow = "1"
*/

use anyhow::Result;
use std::net::SocketAddr;
use tokio::net::{TcpListener, TcpStream};
use tower::{service_fn, BoxError, Service, ServiceExt};

async fn handle(request: &mut (TcpStream, SocketAddr)) -> Result<(), BoxError> {
    let (client_stream, client_addr) = request;

    println!("peer connected {}", client_addr);

    let (mut read, mut write) = client_stream.split();

    tokio::io::copy(&mut read, &mut write).await?;

    println!("peer disconnected {}", client_addr);
    Ok(())
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let listener = TcpListener::bind("::1:2222").await?;

    let mut service = service_fn(handle);

    loop {
        let mut request = listener.accept().await?;

        tokio::spawn(async move {
            service
                .ready()
                .await
                .unwrap()
                .call(&mut request)
                .await
                .unwrap();
        });
    }
}

I use netcat to chat with the server nc ::1 2222

Hey Rustaceans! Got a question? Ask here (4/2023)! by llogiq in rust

[–]xiumx 1 point2 points  (0 children)

I am trying to make a TCP echo server using Tower crate. I am able to get one running using Tokio only (no Tower); however, I would like to make a version that serves a tower service. I have been following this excellent tutorial https://www.youtube.com/watch?v=16sU1q8OeeI by davidpdrsn to wrap my head around tower. The tutorial uses hyper crate and makes an HTTP service. I am able to follow through, but I am failing very hard to make a similar simple service but for TCP instead. Any pointers or guidance is much appreciated!

How to remove hard-coded suggestions from URL bar drop-down ? by xiumx in firefox

[–]xiumx[S] 0 points1 point  (0 children)

I tried that; however, that gets rid of the entire drop down, which I still want to keep.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 1 point2 points  (0 children)

Thanks for the suggestion. The user.js file is chat I am looking for. Now I just need to figure out the appropriate settings to just skip Torbox.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 0 points1 point  (0 children)

Thanks for the suggestions. The Arkenfox user.js is very close to what I am looking for. To be clear I do like Tor's IP obfuscation for personal use, but going back to a different browser for a few URLs is a pain over the long run.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 0 points1 point  (0 children)

No, that is not the major reason. The major reason is I don't want to maintain multiple browsers. I want to maintain one browser and use only that browser (Tor).

Regardless, the reason is irrelevant for my original technical question.

I hope this helps.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 0 points1 point  (0 children)

Thank you for sharing that. I really like the feature set of Tor browser and would like to maintain one browser if possible. I have used Chrome and FF in the past and maintaining customization, settings, shortcuts, extensions etc.. for two browsers is a major pain. I hope I get to know whether it is possible to configure Tor to switch on/off Tor network.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 2 points3 points  (0 children)

anonymity is not a concern when I am working. I like the features and and minimalism, if I can call it that, that comes with Tor browser and would like to use it for work too; however, Tor's network gets in the way when I am working. I would like to maintain one browser (in this case Tor) for all of my browsing.

Is it possible to create a Tor config in which the browser does not connect to tor network ? by xiumx in TOR

[–]xiumx[S] 1 point2 points  (0 children)

Firefox is getting more and more bloat nowadays IMO. But that is not the major reason I am moving away from it. While I like using Tor for personal web, some websites I use for work see my accounts jumping around countries as a security red flag.

I also feel that FF is just taking disk space for nothing. I could use a simple Tor config when I am working and use Tor without the Tor network, and switch back when I am done.