node-x11 icon indicating copy to clipboard operation
node-x11 copied to clipboard

X11 Server

Open RossComputerGuy opened this issue 8 years ago • 13 comments

I'm trying to build my own x11 server and I've built upon the existing code, but I'm stuck at pack_stream.pack("CxSSSa",[1,11,0,hello.length/4,hello]); and I don't know what hello is suppose to be set to.

RossComputerGuy avatar Sep 27 '17 02:09 RossComputerGuy

What type of server you building? I can't remember how complete server side of this library is, and it does not attempt to implement any functionality/semantics at all, just protocol. Intended use case is various types of proxy servers talking to "Real" x11 server

sidorares avatar Sep 27 '17 02:09 sidorares

looks like you are talking about this line: https://github.com/sidorares/node-x11/blob/f040f8bbba7b5be7f1ef1223dde495f92ade3284/lib/xserver.js#L153

( wow, there is hard coded fs.readFile there )

I'm pretty sure this is server side of what happens here: https://github.com/sidorares/node-x11/blob/97a582be5c135c884342035e9967b2480d9e93ea/lib/handshake.js#L111

Have a look at what readServerHello does on client, from there you can figure out how to serialize that on server

sidorares avatar Sep 27 '17 02:09 sidorares

I've not been able to figure it out, I've spent the last few hours looking and couldn't figure it out.

RossComputerGuy avatar Sep 27 '17 03:09 RossComputerGuy

I might be able to help later today but no promices

sidorares avatar Sep 27 '17 04:09 sidorares

Here is a chunk of my working code

this.pack_stream.pack("C",[1]);
		this.pack_stream.flush();
		
		this.pack_stream.pack("xSSSLLLLSSCCCCCCCCxxxxp",[
			this.protocolMajor, // major
			this.protocolMinor, // minor
			(32+this.server.formats.getByteLength()+stringPad(this.vendor)+this.server.screens.getByteLength())/4, // xlen
			0, // release
			this.resource_id_base, // resource_base
			this.resource_id_mask, // resource_mask
			255, // motion_buffer_size
			this.vendor.length, // vlen
			0xffff, // max_request_length
			this.server.screens.arr.length, // screen_num
			this.server.formats.arr.length, // format_num
			0, // image_byte_order
			0, // bitmap_bit_order
			32, // bitmap_scanline_unit
			32, // bitmap_scanline_pad
			8, // min_keycode
			255, // max_keycode
			
			this.vendor // vendor
		]);
		this.pack_stream.flush();
		for(var format of this.server.formats.arr) {
			this.pack_stream = format.pack(this.pack_stream);
			this.pack_stream.flush();
		}
		for(var screen of this.server.screens.arr) {
			this.pack_stream = screen.pack(this.pack_stream);
			this.pack_stream.flush();
		}

RossComputerGuy avatar Sep 28 '17 01:09 RossComputerGuy

X11 Server

RossComputerGuy avatar Nov 14 '18 20:11 RossComputerGuy

not much there yet @SpaceboyRoss01 :) What are you plans re server implementation?

sidorares avatar Nov 14 '18 22:11 sidorares

I plan to write a basic server that people use event listeners to know what happens.14.11.2018, 14:26, "Andrey Sidorov" [email protected]:not much there yet @SpaceboyRoss01 :) What are you plans re server implementation?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

RossComputerGuy avatar Nov 14 '18 22:11 RossComputerGuy

Would it actually implement some x server functionality or act as a proxy to "real" server?

sidorares avatar Nov 14 '18 22:11 sidorares

An actual X Server14.11.2018, 14:33, "Andrey Sidorov" [email protected]:Would it actually implement some x server functionality or act as a proxy to "real" server?

—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.

RossComputerGuy avatar Nov 14 '18 22:11 RossComputerGuy

What would it use for display? Offscreen pixmap / browser / etc?

these two use browser:

https://github.com/GothAck/javascript-x-server https://github.com/ttaubert/x-server-js

sidorares avatar Nov 14 '18 22:11 sidorares

Actually, there's an event that will be emitted when the display is updated.

RossComputerGuy avatar Nov 14 '18 23:11 RossComputerGuy

I might need some help with writing the code to get it to work.

RossComputerGuy avatar Nov 14 '18 23:11 RossComputerGuy